How can i add an enchantment that 1 shots to certain mobs?

Discussion in 'Plugin Development' started by Alqkaria, Dec 6, 2020.

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

    Alqkaria

    So, I am adding a custom enchantment to my plugin. This is my first time ever adding a CE. Can someone tell me the events or the code it self i am going to need?
    (i registered it/coded the wrapper all i need is events and increase the damage)
    Heres the code:
    //Main.java
    package me.Alqkaria.orphan;

    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.event.Listener;
    public class Main extends JavaPlugin implements Listener{
    @Override
    public void onEnable() {
    OrphanEnchants.register();

    this.getServer().getPluginManager().registerEvents(this, this);
    }
    @Override
    public void onDisable() {

    }

    }
     
  2. Offline

    Chr0mosom3

    EntityDamageByEntityEvent

    You check if the damager is a player, and if yes, check if the item they are holding has the specific enchantment.
     
  3. Offline

    Zaary

    Check when projectile lands, if it is arrow then check the mob which it hurted and if its your specific type then set it's health to 0
     
Thread Status:
Not open for further replies.

Share This Page