Potion effect on zombie

Discussion in 'Plugin Development' started by TerroDoor, Dec 15, 2019.

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

    TerroDoor

    I’m using playerinteractentityevent to listen for a right click on a zombie , I tried using LivingEntity to cast the zombie but I get errors when adding the levitation potion

    Is this possible?


    Sent from my iPhone using Tapatalk
     
  2. Online

    timtower Administrator Administrator Moderator

    @TerroDoor Please post your code and the error.
     
  3. Offline

    TerroDoor

    My mistake I made an error in my code,

    I was casting a livingentity to a right click and levitating the entity,

    Here’s what I changed:

    Previous line
    - ent.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION), 120, 1);

    The closed bracket was removed after the ‘levitation’ effect, fixing the error

    New code:
    -ent.addPotionEffect(new PotionEffect(PotionEffectType.LEVITATION, 120, 1);


    Sent from my iPhone using Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page