30 déc. 2014, 23:36

Bonsoir j’ai éssayé d’appliquer un effet de potion sur mes armures mais il ne fonctionne pas et je ne comprends pas pourquoi pouvez vous m’aider s’il vous plait ?
Voici la classe de mon armure :

​package com.phoenixarena.phoenix.common;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

public class ItemAdamantiumArmor extends ItemArmor
{
    public ItemAdamantiumArmor(ArmorMaterial material, int type)
    {
        super(material ,0 ,type);
    }
    public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
    {
        if(stack.getItem()== Phoenix.adamantiumLeggings)
        {
            return Phoenix.MODID + ":textures/models/armor/adamantium_layer_2.png";
        }
        return Phoenix.MODID + ":textures/models/armor/adamantium_layer_1.png";
    }
    //Reparation
    public boolean getIsRepairable(ItemStack input, ItemStack repair)
    {
        if(repair.getItem() == Phoenix.adamantiumPowder)
        {
            return true;
        }
        return false;
    }
    //EFFET SPECIAL : Vitesse
    public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
    {
        player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 20, 0));
    }
}

Merci d’avance 🙂