Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. package com.paradox.ces.enchants.boots;
  2.  
  3. import com.paradox.ces.handlers.TierHandler;
  4. import com.paradox.ces.handlers.TypeHandler;
  5. import com.paradox.ces.objects.CustomEnchant;
  6.  
  7. import cn.nukkit.Player;
  8. import cn.nukkit.event.EventHandler;
  9. import cn.nukkit.event.Listener;
  10. import cn.nukkit.event.entity.EntityArmorChangeEvent;
  11. import cn.nukkit.item.Item;
  12. import cn.nukkit.potion.Effect;
  13.  
  14. public class Supersonic extends CustomEnchant implements Listener {
  15.  
  16. public Supersonic() {
  17. super(TierHandler.legendaryTier, "§aSuperSonic", TypeHandler.boots, TierHandler.legendaryTier.getColor() + "Speed effect whilst wearing!", 2);
  18. }
  19.  
  20. @EventHandler
  21. public void onEquipItem(EntityArmorChangeEvent e){
  22. Player p = (Player) e.getEntity();
  23. Item oldID = e.getOldItem();
  24. Item newID = e.getNewItem();
  25. if (newID.getId() ==313){
  26. if (e.getNewItem().getCustomName().contains("§aSuperSonic 1")){
  27. p.addEffect(Effect.getEffect(Effect.SPEED).setAmplifier(1).setDuration(600*20));
  28. p.sendActionBar("§b§l(§d§l!§b§l) §r§bSuperSonic Activated.");
  29. } else if (e.getNewItem().getCustomName().contains("§aSuperSonic 2")){
  30. p.addEffect(Effect.getEffect(Effect.SPEED).setAmplifier(2).setDuration(600*20));
  31. p.sendActionBar("§b§l(§d§l!§b§l) §r§bSuperSonic Activated.");
  32. }
  33. } else if (oldID.getId() == 313){
  34. p.removeEffect(Effect.SPEED);
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement