Cant figure out how to find out if they are wearing special armor

Discussion in 'Plugin Development' started by xguysprison, Mar 2, 2015.

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

    xguysprison

    so i have this code
    private static ItemStack createSlowSword() {
    ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
    ItemMeta im = sword.getItemMeta();
    im.setDisplayName(ChatColor.AQUA + "Slow Sword");
    List lore = new LinkedList();
    lore.add(ChatColor.RED + "Slow II (4% chance to slow)");
    lore.add(ChatColor.BLUE + "Hero Item");
    im.setLore(lore);
    sword.setItemMeta(im);
    return sword;

    and
    else if (strippedname.equals("Slow Sword")) {
    Random rand = new Random();
    int numb = rand.nextInt(100);
    if (numb <= 4) {
    victim.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 120, 2, false));

    and for my armor i made this


    else if (strippedname.equals("Speed Boots")) {
    victim.addPotionEffect(new PotionEffect(PotionEffectType.SPEED 120, 2, false));

    this is how the code works ect for my slow sword but i dont know what i have to use to figure out if they are using Speed Boots

    for the swords i use
    public void onEntityDamageByEntity(EntityDamageByEntityEvent e)
    {
    if (((e.getDamager() instanceof Player)) &&
    ((e.getEntity() instanceof Player))) {
    Player player = (Player)e.getDamager();
    Player victim = (Player)e.getEntity();
    ItemStack weapon = player.getItemInHand();
    if (weapon == null) {
    return;
    }

    but idk what to do for boots please help me
     
  2. Offline

    CraftCreeper6

  3. Offline

    mine-care

    @xguysprison please do as @CraftCreeper6 said, also, make boots have a unique characteristic on them like a lore or a special name or something so you can know they are suppose to be what they are suppose to be.
     
  4. Offline

    SirMonkeyFood

Thread Status:
Not open for further replies.

Share This Page