#Issues with a outdated plugin

1 messages · Page 1 of 1 (latest)

burnt trout
#

I have a server that's on 1.21, and a plugin I want to use where kills a deaths give positive and negative potion effects, but for some reason you only get the effects when you log out and log back in now, I want to fix this, but I don't know how, my guess is there were some changes to how effects work inbetween 1.20.6 and 1.21

narrow plover
# burnt trout I have a server that's on 1.21, and a plugin I want to use where kills a deaths ...

The plugin doesn't apply potion effects immediately upon kills or deaths in Minecraft 1.21.

It looks like your plugin isn't applying potion effects right away due to changes in Minecraft 1.21. You need to make sure the plugin listens to the correct events and applies the effects immediately. Here's an example of how to do it:

@EventHandler
public void onPlayerKill(EntityDamageByEntityEvent event) {
    if (event.getEntity() instanceof Player && event.getDamager() instanceof Player) {
        Player killer = (Player) event.getDamager();
        if (((Player) event.getEntity()).getHealth() - event.getFinalDamage() <= 0) {
            killer.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 600, 1)); // 30 seconds strength II
        }
    }
}

@EventHandler
public void onPlayerDeath(PlayerDeathEvent event) {
    Player player = event.getEntity();
    player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 600, 1)); // 30 seconds weakness II
}

this will make sure potion effects are applied immedietely at kills and deaths

burnt trout
narrow plover
#

Visit their Github page and create a issue

burnt trout
#

i tried and nothing happened

narrow plover
#

Or You may have misconfigured the plugin, what plugin it is?

burnt trout
narrow plover
#

is it a custom plugin?

burnt trout
burnt trout
narrow plover
#

I'm sorry but I can't really do anything about it