EnchantmentAPI

Discussion in 'Plugin Development' started by DigitalCookie, Apr 12, 2014.

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

    DigitalCookie

    Hello I am creating custom enchants with EnchantmentAPI found HERE. I am creating a slowness effect to test it out but I cant figure out how to add the slowness itself, heres my code

    Code:java
    1. package me.zanilla.vitrolicenchant;
    2.  
    3. import org.bukkit.Material;
    4. import org.bukkit.entity.LivingEntity;
    5. import org.bukkit.event.entity.EntityDamageByEntityEvent;
    6.  
    7. import com.rit.sucy.CustomEnchantment;
    8.  
    9. public class SlownessEnchantment extends CustomEnchantment {
    10.  
    11. static final Material[] SLOWNESS_ITEMS = new Material[] {
    12. Material.WOOD_SWORD, Material.STONE_SWORD, Material.DIAMOND_SWORD, Material.IRON_SWORD, Material.GOLD_SWORD
    13. } ;
    14.  
    15. public SlownessEnchantment() {
    16. super("Slowness", SLOWNESS_ITEMS, 2);
    17.  
    18. this.max = 2;
    19.  
    20. this.base = 1;
    21.  
    22. this.interval = 8;
    23. }
    24.  
    25. public void applyEffect(LivingEntity LivingEntity, int EntityDamageByEntityEvent) {
    26.  
    27.  
    28.  
    29. }
    30.  
     
  2. Offline

    Conarnar

    Code:java
    1. livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, duration, amplifier));
     
Thread Status:
Not open for further replies.

Share This Page