Arrow on bow shot and regeneration 10 for 1 second on kill

Discussion in 'Plugin Development' started by Choubatsu, Jul 5, 2019.

Thread Status:
Not open for further replies.
  1. Offline

    Choubatsu

    Plugin category: Kill Event

    Minecraft version: Bukkit 1.8.8

    Suggested name: No name just code

    What I want: I would nicely ask you for quick code for example when a player shot someone with a bow if he misses he won't receive an arrow, but if he hits he will receive an arrow?
    And regeneration 10 for 1 second on kill of another player.


    Ideas for commands:
    No commands.

    Ideas for permissions:
    No permissions.

    When I'd like it by: As soon as possible.

    Can someone help me with this I'm new to coding? Thank you, kind people :)
     
  2. Online

    timtower Moderator Moderator

    Moved to plugin development.
    @Choubatsu We don't just give code here, we will help you writing it yourself.
    So what have you tried so far?
     
  3. Offline

    KarimAKL

    @Choubatsu Might i ask why this is formatted like the plugin request example post?
    Anyway, to give a player their arrow back if it hits someone you could listen to the EntityDamageByEntityEvent, then check if the damager is an arrow, then get the player who shot the arrow and then add an arrow to that player's inventory.
    To give a player regeneration 10 for 1 second when killing another player you could listen to the EntityDeathEvent, then give the killer the potion effect.
     
Thread Status:
Not open for further replies.

Share This Page