EntityDamageByEntityEvent Not working?

Discussion in 'Plugin Development' started by plisov, Jul 1, 2017.

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


    I've been trying to create a custom mob and make abilities for it but for some reason it doesnt seem to be working. Im trying to make the methods target and snare to work when the player hits the zombie (custom mob) and the rest when the zombie (custom mob) hits the player. Here is the current class.


    Any help is much appreciated. ;)
  2. Offline


    You've to put @EventHandler on top of the method, or put these void inside your main entity event
  3. Offline


    Putting @EventHandler on top of each method will cause an Invalid EventHandler method. There is also no need to put void inside the main entity event.
  4. Offline


    Mabye a really stupid thing you could try: try putting the event in the first order of the methods.
    private void confuse(EntityDamageByEntityEvent event, Player player){
    And by the way, like @plisov said: use @EventHandler for each method
  5. Offline


    @dutchjelly @plisov
    Events can only be called if there is nothing else in the method's parameter and if there is the event handler tag. Remove the player variable and add the @Event handler tag.
  6. Offline


    Yeah I think you're right. You can always get the player through the event.
Thread Status:
Not open for further replies.

Share This Page