Development Assistance Applying potion effects to mobs

Discussion in 'Plugin Help/Development/Requests' started by BizarrePlatinum, Jul 2, 2015.

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

    BizarrePlatinum

    I'm currently trying to add potion effects to mobs when they're hit by certain projectiles. I tried spawning a splash potion, but it just didn't work too well. So, I figured I'd see how I could do this with packets. If someone could provide some help with that, it'd be great.

    EDIT - It appears that living entity actually has the method addPotionEffect. I'll test this and see if it works (probably will).

    Now a new problem arises. Slowness appears to be working, however, it is not working for poison or wither, no errors, they're just not applying the effects.

    Show Spoiler

    Code:
    else if(poisonUUIDS.contains(arrow.getUniqueId())) {
                            if(livingEntity instanceof Player) {
                                Player livingP = (Player) livingEntity;
                                livingP.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 2));
                                poisonUUIDS.remove(arrow.getUniqueId());
                            } else {
                                livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 100, 2));
                                poisonUUIDS.remove(arrow.getUniqueId());
                            }
                        }
    [...]
    else if(witherUUIDS.contains(arrow.getUniqueId())) {
                            if(livingEntity instanceof Player) {
                                Player livingP = (Player) livingEntity;
                                livingP.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 100, 1));
                                witherUUIDS.remove(arrow.getUniqueId());
                            } else {
                                livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 100, 1));
                                witherUUIDS.remove(arrow.getUniqueId());
                            }
    

    The lists should contain the uuids, so I'm not really sure what is causing them not to work.
     
    Last edited: Jul 3, 2015
  2. Offline

    BizarrePlatinum

  3. I'll help tomorrow if no one helps and I remember to. I can tell you my reply isn't promising. I already wrote it, was about to press Post and my chrome crashed (iPad) so my huge paragraph disappeared. It's 3:30am for me so I'm not bothered to retype it right now.

    Just wondering, why did you put this in the Bukkit Alternatives section? Barely anyone comes here, so if you really need help for something like Spigot, go to that corresponding forum, e.g. spigot forums. Or, if not using NMS, nobody'll know if you're using an alternative Bukkit, so post in the main plugin development section next time. xD
     
Thread Status:
Not open for further replies.

Share This Page