Créer une armure
-
Non, faut le faire depuis un event : https://github.com/FFMT/nanotech_mod/blob/master/common/fr/mcnanotech/kevin_68/nanotechmod/main/event/RenderEvent.java#L31-L67
-
Salut à tous,
j’aimerais que quand le personnage porte toute l’armure et qu’il est frappé par un autre joueur, cet autre joueur soit téléporté entre 5 et 10 blocs (X et Y) plus loin. Le problème est que je ne sais pas comment récupérer les coordonnées du joueur attaquant et je ne sais pas comment lui assigner de nouvelles coordonnées. Pour l’instant j’ai fais ca :@SubscribeEvent public void onLivingHurt(LivingHurtEvent event) { ItemStack boots = event.entityLiving.getEquipmentInSlot(1); ItemStack leggings = event.entityLiving.getEquipmentInSlot(2); ItemStack chestPlate = event.entityLiving.getEquipmentInSlot(3); ItemStack helmet = event.entityLiving.getEquipmentInSlot(4); if(boots != null && boots.getItem() == MorePowerCraft.mysticBoots && leggings != null && leggings.getItem() == MorePowerCraft.mysticLegs && chestPlate != null && chestPlate.getItem() == MorePowerCraft.mysticBody && helmet != null && helmet.getItem() == MorePowerCraft.mysticHelmet) { if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayerMP) { // Je ne sais pas quoi mettre… } } }Merci d’avance :rolleyes:
PS : Quelle est la différence entre EntityPlayer, EntityPlayerMP et EntityPlayerSP ?
-
EntityPlayer -> Un joueur, que ce soit côté client ou serveur
EntityPlayerMP -> classe extends EntityPlayer, le joueur côté serveur, permet d’accéder à des fonctions disponible que côté serveur. Mais ducoup ça fonctionne que côté serveur.
EntityPlayerSP -> Même chose mais pour le client.Pour le // Je ne sais pas quoi mettre… :
int x = (int)((event.source.getEntity().posX + event.source.getEntity().worldObj.rand.nextInt(5) + 5) * Math.pow(-1, (double)rand.nextInt(1)); int z = (int)((event.source.getEntity().posZ + event.source.getEntity().worldObj.rand.nextInt(5) + 5) * Math.pow(-1, (double)rand.nextInt(1)); int y = (int)(event.source.getEntity().posY); while(!event.source.getEntity().worldObj.isAirBlock(x, y, z) { y ++; } event.source.getEntity().setPositionAndUpdate(x, y, z);Code fait à la main, j’ai pas vérifier, tu me dira si c’est bon ou pas.
-
@‘robin4002’:
EntityPlayer -> Un joueur, que ce soit côté client ou serveur
EntityPlayerMP -> classe extends EntityPlayer, le joueur côté serveur, permet d’accéder à des fonctions disponible que côté serveur. Mais ducoup ça fonctionne que côté serveur.
EntityPlayerSP -> Même chose mais pour le client.Pour le // Je ne sais pas quoi mettre… :
int x = (int)((event.source.getEntity().posX + event.source.getEntity().worldObj.rand.nextInt(5) + 5) * Math.pow(-1, (double)rand.nextInt(1)); int z = (int)((event.source.getEntity().posZ + event.source.getEntity().worldObj.rand.nextInt(5) + 5) * Math.pow(-1, (double)rand.nextInt(1)); int y = (int)(event.source.getEntity().posY); while(!event.source.getEntity().worldObj.isAirBlock(x, y, z) { y ++; } event.source.getEntity().setPositionAndUpdate(x, y, z);Code fait à la main, j’ai pas vérifier, tu me dira si c’est bon ou pas.
Merci pour ta réponse rapide

J’ai une erreur “rand cannot be resolved” ici :
-
Remplace rand par event.source.getEntity().worldObj.rand et setPositionAndUpdate par setPosition.
-
@‘robin4002’:
Remplace rand par event.source.getEntity().worldObj.rand et setPositionAndUpdate par setPosition.
Ca marche nickel !
Merci beaucoup
-
Salut,
Pour ceux qui auraient besoin d’aide sur les layers d’armures, il y a ce super lien (en anglais)
-
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


