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
#Issues with a outdated plugin
1 messages · Page 1 of 1 (latest)
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
i don't code, do you think if i sent you the plugin you could locate and fix the issue for me?
You should ask plugin developer
Visit their Github page and create a issue
i tried and nothing happened
Or You may have misconfigured the plugin, what plugin it is?
is it a custom plugin?
its not something in the config i've tried
it was on spigot but the dev has nothing for me to contact them on
Could you send me spigot page?
I'm sorry but I can't really do anything about it