Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.paradox.ces.enchants.boots;
- import com.paradox.ces.handlers.TierHandler;
- import com.paradox.ces.handlers.TypeHandler;
- import com.paradox.ces.objects.CustomEnchant;
- import cn.nukkit.Player;
- import cn.nukkit.event.EventHandler;
- import cn.nukkit.event.Listener;
- import cn.nukkit.event.entity.EntityArmorChangeEvent;
- import cn.nukkit.item.Item;
- import cn.nukkit.potion.Effect;
- public class Supersonic extends CustomEnchant implements Listener {
- public Supersonic() {
- super(TierHandler.legendaryTier, "§aSuperSonic", TypeHandler.boots, TierHandler.legendaryTier.getColor() + "Speed effect whilst wearing!", 2);
- }
- @EventHandler
- public void onEquipItem(EntityArmorChangeEvent e){
- Player p = (Player) e.getEntity();
- Item oldID = e.getOldItem();
- Item newID = e.getNewItem();
- if (newID.getId() ==313){
- if (e.getNewItem().getCustomName().contains("§aSuperSonic 1")){
- p.addEffect(Effect.getEffect(Effect.SPEED).setAmplifier(1).setDuration(600*20));
- p.sendActionBar("§b§l(§d§l!§b§l) §r§bSuperSonic Activated.");
- } else if (e.getNewItem().getCustomName().contains("§aSuperSonic 2")){
- p.addEffect(Effect.getEffect(Effect.SPEED).setAmplifier(2).setDuration(600*20));
- p.sendActionBar("§b§l(§d§l!§b§l) §r§bSuperSonic Activated.");
- }
- } else if (oldID.getId() == 313){
- p.removeEffect(Effect.SPEED);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement