Créer une armure
-
Pour info, si vous modifiez la vitesse d’un joueur (en tout cas pour moi) et que ce dernier vole (par exemple en créa), ça vous envoie à panplume, du coup il faut ajouter une condition pour savoir si le joueur est au sol ou non.
if(this.armorType == 2 && player.onGround)
-
Bonjour de mon coté j’ai un problème de texture, j’ai appelez mister isador à la rescousse mais même ce dernier n’as pas trouvez le problème, je peux lancez le jeux (sa crash pas exploit lol)
je peux équipez la chose, mais aucune texturedonc je me tourne vers vous (on ce tourne car isador est avec moi sur le coup ^^)
voila la chose en détail
public static Item helmetMK1, bodyMK1, legMK1, bootsMK1;
helmetMK1 = new helmetMK1(armorTuto, 0).setUnlocalizedName("helmetTuto").setTextureName(c_drone + ":Mk_I.1.png"); bodyMK1 = new bodyMK1(armorTuto, 1).setUnlocalizedName("chestPlateTuto").setTextureName(c_drone + ":Mk_I.1.png"); legMK1 = new legMK1(armorTuto, 2).setUnlocalizedName("leggingsTuto").setTextureName(c_drone + ":Mk_I.2.png"); bootsMK1 = new bootsMK1(armorTuto, 3).setUnlocalizedName("bootsTuto").setTextureName(c_drone + ":Mk_I.2.png");
GameRegistry.registerItem(helmetMK1, "item_tuto_helmet"); GameRegistry.registerItem(bodyMK1, "item_tuto_chestplate"); GameRegistry.registerItem(legMK1, "item_tuto_leggings"); GameRegistry.registerItem(bootsMK1, "item_tuto_boots");
package fr.celestiafrance.c_drone.common; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class helmetMK1 extends ItemArmor { public helmetMK1(ArmorMaterial material, int type) { super(material, 0, type); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if (slot == 0) { return c_drone.c_drone + ":textures/armor/Mk_I.png"; } return c_drone.c_drone + ":textures/armor/Mk_I2.png"; } }
ou est ma connerie …
-
Tu peux donner l’erreur dans les log (ou venir sur skype)
-
j’ai ça dans les logs
Failed to load texture: fr.celestiafrance.c_drone.common.c_dronecreativetabs@46df794e:textures/armor/Mk_I.png
java.io.FileNotFoundException: fr.celestiafrance.c_drone.common.c_dronecreativetabs@46df794e:textures/armor/Mk_I.png
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:71) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[SimpleTexture.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?]
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:62) [Render.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:74) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:516) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:171) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:564) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:283) [RenderManager.class:?]
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(GuiInventory.java:116) [GuiInventory.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:838) [GuiContainerCreative.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:97) [GuiContainer.class:?]
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) [InventoryEffectRenderer.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:672) [GuiContainerCreative.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1143) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1023) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:910) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] -
c_drone.c_drone ?
-
modtuto+modID
nom du mod + nom de la classe ? -
Rien compris x)
Envoie ta classe principale entière. -
c’est bon problème réglé
diangle, m’as filez un coup de main ^^
-
lu j’ai un “autre” problème
j’ai tester le code
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { if (this.armorType == 2 && player.isSprinting()) { player.motionX *= 1.3F; player.motionZ *= 1.3F; }
et quand je “saute” mon perso parcourt des distance hallucinante (2-3000 bloc d’un coup )
moyen d’empêcher cela ??
-
if (this.armorType == 2 && player.isSprinting() && player.onGround) {
Je vais modifier le tuto.
-
merci
-
Bonjour voila je viens de creer mon petit mode mais j’aimerait pouvoir réparer les armures et outils a partir du minerai mais je n’arrive a faire cela que celle a partir du quel j’ai créer le minerai. C’est a dire j’aimerait pouvoir réparer mon armure et mes outils en émeraude mais je ne trouve pas comment faire. Voici mon code
Pour ma classe principale :
package fr.volario.mod.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; import fr.volario.mod.proxy.CommonProxy; import net.minecraftforge.common.MinecraftForge; import net.minecraft.block.Block; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "modemerald", name = "ModEmerald", version = "1.0.0") public class ModEmerald { @Instance("ModEmerald") public static ModEmerald Instance; public static final String MODID = "ModEmerald"; @SidedProxy(clientSide = "fr.volario.mod.proxy.ClientProxy", serverSide = "fr.volario.mod.proxy.CommonProxy") public static CommonProxy proxy; public static Item Sapphire, Ruby, helmetEmerald, chestPlateEmerald, leggingsEmerald, bootsEmerald, helmetRuby, chestPlateRuby, leggingsRuby, bootsRuby, helmetSapphire, chestPlateSapphire, bootsSapphire, leggingsSapphire; public static Item HoeRuby, HoeSapphire, HoeEmerald; public static Item ShovelRuby, ShovelSapphire, ShovelEmerald; public static Item AxeRuby, AxeSapphire, AxeEmerald; public static Item PickAxeRuby, PickAxeSapphire, PickAxeEmerald; public static Item SwordRuby, SwordSapphire, SwordEmerald; public static EnumToolMaterial toolEmerald = EnumHelper.addToolMaterial("toolEmerald", 3, 2000, 13.0F, 4.0F, 15); public static EnumToolMaterial toolRuby = EnumHelper.addToolMaterial("toolRuby", 3, 2500, 18.0F, 6.0F, 15); public static EnumToolMaterial toolSapphire = EnumHelper.addToolMaterial("toolSapphire", 3, 3000, 23.0F, 8.0F, 15); public static EnumArmorMaterial ItemEmeraldArmor = EnumHelper.addArmorMaterial("armorEmerald", 35, new int[] {4, 9, 7, 4}, 10); public static EnumArmorMaterial ItemRubyArmor = EnumHelper.addArmorMaterial("armorRuby", 35, new int[] {5, 10, 8, 5}, 10); public static EnumArmorMaterial ItemSapphireArmor = EnumHelper.addArmorMaterial("armorSapphire", 35, new int[] {6, 11, 9, 6}, 10); @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.registerRender(); } @EventHandler public void init(FMLInitializationEvent event) { Sapphire = new Sapphire(10015) .setUnlocalizedName("Sapphire") .setTextureName(ModEmerald.MODID + ":Sapphire") .setCreativeTab(CreativeTabs.tabMaterials); Ruby = new Ruby(10014) .setUnlocalizedName("Ruby") .setTextureName(ModEmerald.MODID + ":Ruby") .setCreativeTab(CreativeTabs.tabMaterials); HoeRuby = new HoeRuby(10016, toolRuby) .setUnlocalizedName("HoeRuby") .setTextureName(ModEmerald.MODID + ":HoeRuby") .setCreativeTab(CreativeTabs.tabTools); HoeEmerald = new HoeEmerald(10017, toolEmerald) .setUnlocalizedName("HoeEmerald") .setTextureName(ModEmerald.MODID + ":HoeEmerald") .setCreativeTab(CreativeTabs.tabTools); HoeSapphire = new HoeSapphire(10018, toolSapphire) .setUnlocalizedName("HoeSapphire") .setTextureName(ModEmerald.MODID + ":HoeSapphire") .setCreativeTab(CreativeTabs.tabTools); AxeRuby = new AxeRuby(10019, toolRuby) .setUnlocalizedName("AxeRuby") .setTextureName(ModEmerald.MODID + ":AxeRuby") .setCreativeTab(CreativeTabs.tabTools); AxeEmerald = new AxeEmerald(10020, toolEmerald) .setUnlocalizedName("AxeEmerald") .setTextureName(ModEmerald.MODID + ":AxeEmerald") .setCreativeTab(CreativeTabs.tabTools); AxeSapphire = new AxeSapphire(10021, toolSapphire) .setUnlocalizedName("AxeSapphire") .setTextureName(ModEmerald.MODID + ":AxeSapphire") .setCreativeTab(CreativeTabs.tabTools); ShovelRuby = new ShovelRuby(10022, toolRuby) .setUnlocalizedName("ShovelRuby") .setTextureName(ModEmerald.MODID + ":ShovelRuby") .setCreativeTab(CreativeTabs.tabTools); ShovelEmerald = new ShovelEmerald(10023, toolEmerald) .setUnlocalizedName("ShovelEmerald") .setTextureName(ModEmerald.MODID + ":ShovelEmerald") .setCreativeTab(CreativeTabs.tabTools); ShovelSapphire = new ShovelSapphire(10024, toolSapphire) .setUnlocalizedName("ShovelSapphire") .setTextureName(ModEmerald.MODID + ":ShovelSapphire") .setCreativeTab(CreativeTabs.tabTools); PickAxeRuby = new PickAxeRuby(10025, toolRuby) .setUnlocalizedName("PickAxeRuby") .setTextureName(ModEmerald.MODID + ":PickAxeRuby") .setCreativeTab(CreativeTabs.tabTools); PickAxeEmerald = new PickAxeEmerald(10026, toolEmerald) .setUnlocalizedName("PickAxeEmerald") .setTextureName(ModEmerald.MODID + ":PickAxeEmerald") .setCreativeTab(CreativeTabs.tabTools); PickAxeSapphire = new PickAxeSapphire(10027, toolSapphire) .setUnlocalizedName("PickAxeSapphire") .setTextureName(ModEmerald.MODID + ":PickAxeSapphire") .setCreativeTab(CreativeTabs.tabTools); SwordRuby = new SwordRuby(10028, toolRuby) .setUnlocalizedName("SwordRuby") .setTextureName(ModEmerald.MODID + ":SwordRuby") .setCreativeTab(CreativeTabs.tabCombat); SwordEmerald = new SwordEmerald(10029, toolEmerald) .setUnlocalizedName("SwordEmerald") .setTextureName(ModEmerald.MODID + ":SwordEmerald") .setCreativeTab(CreativeTabs.tabCombat); SwordSapphire = new SwordSapphire(10030, toolSapphire) .setUnlocalizedName("SwordSapphire") .setTextureName(ModEmerald.MODID + ":SwordSapphire") .setCreativeTab(CreativeTabs.tabCombat); helmetEmerald = new EmeraldArmor(12002, ItemEmeraldArmor, 0,0) .setUnlocalizedName("EmeraldHelmet") .setTextureName("modemerald:EmeraldHelmet"); chestPlateEmerald = new EmeraldArmor(12003, ItemEmeraldArmor, 0, 1) .setUnlocalizedName("EmeraldChestPlate") .setTextureName("modemerald:EmeraldChestplate"); leggingsEmerald = new EmeraldArmor(12004, ItemEmeraldArmor, 0, 2) .setUnlocalizedName("EmeraldLeggings") .setTextureName("modemerald:EmeraldLeggings"); bootsEmerald = new EmeraldArmor(12005, ItemEmeraldArmor, 0, 3) .setUnlocalizedName("EmeraldBoots") .setTextureName("modemerald:EmeraldBoots"); helmetRuby = new RubyArmor(12006, ItemRubyArmor, 0,0) .setUnlocalizedName("RubyHelmet") .setTextureName("modemerald:RubyHelmet"); chestPlateRuby = new RubyArmor(12007, ItemRubyArmor, 0, 1) .setUnlocalizedName("RubyChestPlate") .setTextureName("modemerald:RubyChestplate"); leggingsRuby = new RubyArmor(12008, ItemRubyArmor, 0, 2) .setUnlocalizedName("RubyLeggings") .setTextureName("modemerald:RubyLeggings"); bootsRuby = new RubyArmor(12009, ItemRubyArmor, 0, 3) .setUnlocalizedName("RubyBoots") .setTextureName("modemerald:RubyBoots"); helmetSapphire = new SapphireArmor(12010, ItemSapphireArmor, 0,0) .setUnlocalizedName("SapphireHelmet") .setTextureName("modemerald:SapphireHelmet"); chestPlateSapphire = new SapphireArmor(12011, ItemSapphireArmor, 0, 1) .setUnlocalizedName("SapphireChestPlate") .setTextureName("modemerald:SapphireChestplate"); leggingsSapphire = new SapphireArmor(12012, ItemSapphireArmor, 0, 2) .setUnlocalizedName("SapphireLeggings") .setTextureName("modemerald:SapphireLeggings"); bootsSapphire = new SapphireArmor(12013, ItemSapphireArmor, 0, 3) .setUnlocalizedName("SapphireBoots") .setTextureName("modemerald:SapphireBoots"); GameRegistry.registerItem(AxeEmerald, "AxeEmerald"); GameRegistry.registerItem(AxeRuby, "AxeRuby"); GameRegistry.registerItem(AxeSapphire, "AxeSapphire"); GameRegistry.registerItem(ShovelEmerald, "ShovelEmerald"); GameRegistry.registerItem(ShovelRuby, "ShovelRuby"); GameRegistry.registerItem(ShovelSapphire, "ShovelSapphire"); GameRegistry.registerItem(PickAxeEmerald, "PickAxeEmerald"); GameRegistry.registerItem(PickAxeRuby, "PickAxeRuby"); GameRegistry.registerItem(PickAxeSapphire, "PickAxeSapphire"); GameRegistry.registerItem(HoeEmerald, "HoeEmerald"); GameRegistry.registerItem(HoeRuby, "HoeRuby"); GameRegistry.registerItem(HoeSapphire, "HoeSapphire"); GameRegistry.registerItem(Ruby, "Ruby"); GameRegistry.registerItem(Sapphire, "Sapphire"); GameRegistry.addRecipe(new ItemStack(helmetEmerald), new Object[]{"XXX", "X X", 'X', Item.emerald, }); GameRegistry.addRecipe(new ItemStack(chestPlateEmerald), new Object[]{"X X", "XXX", "XXX", 'X', Item.emerald, }); GameRegistry.addRecipe(new ItemStack(leggingsEmerald), new Object[]{"XXX", "X X", "X X", 'X', Item.emerald, }); GameRegistry.addRecipe(new ItemStack(bootsEmerald), new Object[]{"X X", "X X", 'X', Item.emerald, }); GameRegistry.addRecipe(new ItemStack(PickAxeEmerald), new Object[]{"XXX", " S ", " S ", 'X', Item.emerald, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(SwordEmerald), new Object[]{"X", "X", "S", 'X', Item.emerald, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(HoeEmerald), new Object[]{"XX", " #", " #", 'X', Item.emerald, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(ShovelEmerald), new Object[]{"X", "#", "#", 'X', Item.emerald, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(AxeEmerald), new Object[]{"XX", "X#", " #", 'X', Item.emerald, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(helmetRuby), new Object[]{"XXX", "X X", 'X', Ruby, }); GameRegistry.addRecipe(new ItemStack(chestPlateRuby), new Object[]{"X X", "XXX", "XXX", 'X', Ruby, }); GameRegistry.addRecipe(new ItemStack(leggingsRuby), new Object[]{"XXX", "X X", "X X", 'X', Ruby, }); GameRegistry.addRecipe(new ItemStack(bootsRuby), new Object[]{"X X", "X X", 'X', Ruby, }); GameRegistry.addRecipe(new ItemStack(PickAxeRuby), new Object[]{"XXX", " S ", " S ", 'X', Ruby, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(SwordRuby), new Object[]{"X", "X", "S", 'X', Ruby, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(HoeRuby), new Object[]{"XX", " #", " #", 'X', Ruby, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(ShovelRuby), new Object[]{"X", "#", "#", 'X', Ruby, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(AxeRuby), new Object[]{"XX", "X#", " #", 'X', Ruby, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(helmetSapphire), new Object[]{"XXX", "X X", 'X', Sapphire, }); GameRegistry.addRecipe(new ItemStack(chestPlateSapphire), new Object[]{"X X", "XXX", "XXX", 'X', Sapphire, }); GameRegistry.addRecipe(new ItemStack(leggingsSapphire), new Object[]{"XXX", "X X", "X X", 'X', Sapphire, }); GameRegistry.addRecipe(new ItemStack(bootsSapphire), new Object[]{"X X", "X X", 'X', Sapphire, }); GameRegistry.addRecipe(new ItemStack(PickAxeSapphire), new Object[]{"XXX", " S ", " S ", 'X', Sapphire, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(SwordSapphire), new Object[]{"X", "X", "S", 'X', Sapphire, 'S', Item.stick }); GameRegistry.addRecipe(new ItemStack(HoeSapphire), new Object[]{"XX", " #", " #", 'X', Sapphire, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(ShovelSapphire), new Object[]{"X", "#", "#", 'X', Sapphire, '#', Item.stick }); GameRegistry.addRecipe(new ItemStack(AxeSapphire), new Object[]{"XX", "X#", " #", 'X', Sapphire, '#', Item.stick }); } private void setCreativeTab(CreativeTabs tabcombat) { // TODO Auto-generated method stub } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Et pour ma class Armure Emeraude
package fr.volario.mod.common; import net.minecraft.item.ItemArmor; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class EmeraldArmor extends ItemArmor { public EmeraldArmor(int id, EnumArmorMaterial armorMaterial, int type, int layer) { super(id, armorMaterial, type, layer); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(slot == 2) { return ModEmerald.MODID + ":textures/models/armor/armoremerald_layer_1.png"; } return ModEmerald.MODID + ":textures/models/armor/armoremerald_layer_2.png"; } public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == ModEmerald.item.Emerald) { return true; } return false; } }
Et la class d’un de mes outils en émeraude :
package fr.volario.mod.common; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; public class AxeEmerald extends ItemAxe { public AxeEmerald(int id, EnumToolMaterial toolMaterial) { super(id, toolMaterial); } public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == ModEmerald.item.emerald) { return true; } return false; } }
-
public boolean getIsRepairable(ItemStack input, ItemStack repair) { if(repair.getItem() == Item.emerald) { return true; } return false; }
Par contre comme tu codes en 1.6.4, ça serait mieux de poster dans le tutoriel 1.6.4 et non dans le tutoriel 1.7.x
-
Merci bien de votre réponse
-
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
-
Tu es en quel version ? 1.7 ou 1.8 ?
-
Ajoute @Override au dessus de la fonction onArmorTick. Il t’indique quoi ?
-
salut je voudrai savoir quel est la condition a mettre pour dire a mon armure que les effet doit être actif quand mon set d’armure est complète. Merci d’avance ^^
package CrystalCombats; import CrystalTools.CrystalTool; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; 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 ItemGreenCrystalArmor extends ItemArmor { public ItemGreenCrystalArmor(ArmorMaterial enumArmorMaterial, int slot, int layer) { super(enumArmorMaterial, slot, layer); } @SideOnly(Side.CLIENT) @Override public EnumRarity getRarity(ItemStack stack) { return EnumRarity.rare; } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(stack.getItem() == CrystalCombat.greenCrystalHelmet || stack.getItem() == CrystalCombat.greenCrystalChestPlate || stack.getItem() == CrystalCombat.greenCrystalBoots) return "minecraft:textures/models/armor/greencrystal_layer_1.png"; else if(stack.getItem() == CrystalCombat.greenCrystalLeggings) return "minecraft:textures/models/armor/greencrystal_layer_2.png"; else return null; } public void onArmorTick(World world, EntityPlayer player, ItemStack stack) { player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 20, 0)); player.addPotionEffect(new PotionEffect(Potion.invisibility.id, 20, 0)); player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 20, 0)); } }
-
Bonjour, tous d’abord excellent tutoriel
mais j’aurais une question comment peut t’on faire pour quand on prend des dégât de chute l’armure perdent en durabilité car contre des mobs j’en perd mais pas quand je tombe de hautMerci d’avance, TheAzylium
-
@‘TheAzylium’:
Bonjour, tous d’abord excellent tutoriel
mais j’aurais une question comment peut t’on faire pour quand on prend des dégât de chute l’armure perdent en durabilité car contre des mobs j’en perd mais pas quand je tombe de hautMerci d’avance, TheAzylium
Ce calcul est fait lors du calcul d’armure, dans la logique de minecraft, c’est les bottes qui prennent les dégâts. Pour contrer ça tu peux utiliser le livingFallEvent ou le LivingHurtEvent dans lequel tu baisse la durabilité manuellement (je me rappelle plus de la fonction à utiliser)