Créer un item basique
-
Bonjours j’ai un probleme:
mon mod n’ai pas reconnucontenue de la class principal:
package com.google.smalycraft.misterfire.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import com.google.smalycraft.misterfire.proxy.CommonProxy; 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; @Mod(modid = "misterfire.MODID", name = "MisterFire", version = "1.0.0") public class MisterFire { public static String MODID = "fraise"; @Instance ("misterfire") public static MisterFire instance; @SidedProxy(clientSide = "com.google.smalycraft.misterfire.proxy.CommonProxy" , serverSide = "com.google.smalycraft.misterfire.proxy.CommonProxy") public static CommonProxy proxy; public static Item fraise; @EventHandler public void preInit(FMLPreInitializationEvent event) { fraise = new fraise().setUnlocalizedName("fraise").setTextureName(MODID + ":fraise").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(fraise, "fraise"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
contenue de la class de l’item:
package com.google.smalycraft.misterfire.common; import net.minecraft.item.Item; public class fraise extends Item { }
-
@‘MisterFire34’:
Bonjours j’ai un probleme:
mon mod n’ai pas reconnucontenue de la class principal:
package com.google.smalycraft.misterfire.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import com.google.smalycraft.misterfire.proxy.CommonProxy; 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; @Mod(modid = "misterfire.MODID", name = "MisterFire", version = "1.0.0") public class MisterFire { public static String MODID = "fraise"; @Instance ("misterfire") public static MisterFire instance; @SidedProxy(clientSide = "com.google.smalycraft.misterfire.proxy.CommonProxy" , serverSide = "com.google.smalycraft.misterfire.proxy.CommonProxy") public static CommonProxy proxy; public static Item fraise; @EventHandler public void preInit(FMLPreInitializationEvent event) { fraise = new fraise().setUnlocalizedName("fraise").setTextureName(MODID + ":fraise").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(fraise, "fraise"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
contenue de la class de l’item:
package com.google.smalycraft.misterfire.common; import net.minecraft.item.Item; public class fraise extends Item { }
package com.google.smalycraft.misterfire.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import com.google.smalycraft.misterfire.proxy.CommonProxy; 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; @Mod(modid = misterfire.MODID, name = "MisterFire", version = "1.0.0") public class MisterFire { public static String MODID = "fraise"; @Instance (MODID) public static MisterFire instance; @SidedProxy(clientSide = "com.google.smalycraft.misterfire.proxy.CommonProxy" , serverSide = "com.google.smalycraft.misterfire.proxy.CommonProxy") public static CommonProxy proxy; public static Item fraise; @EventHandler public void preInit(FMLPreInitializationEvent event) { fraise = new fraise().setUnlocalizedName("fraise").setTextureName(MODID + ":fraise").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(fraise, "fraise"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Sa doit être comme ça plutôt ^^.
-
@‘Diangle’:
@‘MisterFire34’:
Bonjours j’ai un probleme:
mon mod n’ai pas reconnucontenue de la class principal:
package com.google.smalycraft.misterfire.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import com.google.smalycraft.misterfire.proxy.CommonProxy; 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; @Mod(modid = "misterfire.MODID", name = "MisterFire", version = "1.0.0") public class MisterFire { public static String MODID = "fraise"; @Instance ("misterfire") public static MisterFire instance; @SidedProxy(clientSide = "com.google.smalycraft.misterfire.proxy.CommonProxy" , serverSide = "com.google.smalycraft.misterfire.proxy.CommonProxy") public static CommonProxy proxy; public static Item fraise; @EventHandler public void preInit(FMLPreInitializationEvent event) { fraise = new fraise().setUnlocalizedName("fraise").setTextureName(MODID + ":fraise").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(fraise, "fraise"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
contenue de la class de l’item:
package com.google.smalycraft.misterfire.common; import net.minecraft.item.Item; public class fraise extends Item { }
package com.google.smalycraft.misterfire.common; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import com.google.smalycraft.misterfire.proxy.CommonProxy; 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; @Mod(modid = misterfire.MODID, name = "MisterFire", version = "1.0.0") public class MisterFire { public static String MODID = "fraise"; @Instance (MODID) public static MisterFire instance; @SidedProxy(clientSide = "com.google.smalycraft.misterfire.proxy.CommonProxy" , serverSide = "com.google.smalycraft.misterfire.proxy.CommonProxy") public static CommonProxy proxy; public static Item fraise; @EventHandler public void preInit(FMLPreInitializationEvent event) { fraise = new fraise().setUnlocalizedName("fraise").setTextureName(MODID + ":fraise").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(fraise, "fraise"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Sa doit être comme ça plutôt ^^.
il y a 2 erreur:
la: @Mod(modid = misterfire.MODID, name = “MisterFire”, version = “1.0.0”)
et la: @Instance (MODID)
-
Ctrl + Shift + O
-
@‘MrAzErTy31’:
Ctrl + Shift + O
sa marche pas
-
Quelle est l’erreur dont tu parle ?
-
sa na résolut aucune erreur
erreur1: misterfire cannot be resolved to a variable
erreur 2:The value for annotation attribute Mod.Instance.value must be a constant expression
-
Pour la première erreur, change l’annotation “mod” en ceci :
@Mod(modid = misterfire.MODID, name = “MisterFire”, version = “1.0.0”)
Et pour la deuxième, Change le "@Instance(MODID) en “@Instance(“fraise”)”
-
la 1er erreur persiste
mais la 2eme ne saffiche plus -
Ah mince désolé x)
Je me suis trompé de fix ^^
Change la première en ceci :
@Mod(modid = Misterfire.MODID, name = “MisterFire”, version = “1.0.0”) -
même problème
-
@‘MrAzErTy31’:
Ah mince désolé x)
Je me suis trompé de fix ^^
Change la première en ceci :
@Mod(modid = Misterfire.MODID, name = “MisterFire”, version = “1.0.0”)la même erreur
-
Alors change en “MisterFire.MODID” (Robin tu pourras faire un petit clean des messages ? car là on flood le tutoriel :x)
-
Tu as bien mit le M majuscule ? Car normalement ça devrait être bon.
-
cela me met une autre erreur: The value for annotation attribute Mod.modid must be a constant expression
-
Change la ligne
public static String MODID = "fraise";
en :
public static final String MODID = "fraise";
-
sa marche merci a vous 2
superbe communauté sur ce forum
Ha le mod ne marche toujours pas -
Ca te dit quoi ?
-
rien sa me fait comme avant le mod n’ai pas afficher dans Mod
-
Regarde dans la console au lancement de ton mod et dis nous si tu vois des erreurs.