Résolu Utiliser un item d'un autre mod
-
S’lut
J’aimerais équipé mon mob d’un item d’un autre mod ( http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1289132-vanillaplus-v1-4-4-brings-what-should-be-in ) , mais je ne sais pas comment m’y prendre :s
J’ai trouvé ça mais je ne comprend rien http://www.minecraftforge.net/wiki/Developing_Addons_for_Existing_Mods :s
Si quelqu’un pouvait me dire comment faire :rolleyes:
Merci -
Tu fais comme pour un item normal (sans créer la classe de l’item) et dans ta class principale eu lieu de ca: GameRegistry.registerItem(name, name_quandtufaisle/give(par exemple)); tu mets ca :GameRegistry.findItem(modId, name);
-
Merci je vais essayé ça
-
Ok j’ai fait comme tu as dit:
GameRegistry.findItem("VanillaPlus", "rubySword");
MAIS après quand je veux donner l’épée pour mon mob
L’item n’est pas reconnuthis.setCurrentItemOrArmor(0, new ItemStack(VanillaPlus.rubySword));
-
As tu mis: public static Item itemRubySword; puis dans ton preInit: itemRubySword = GameRegistry.findItem(“VanillaPlus”, “rubySword”);. Essaye ca, si ça ne marche pas mets ca: GameRegistry.registerItem(itemRubySword, “rubySword”, “VanillaPlus”);
-
J’ai essayé ce que tu as dit
Je n’ai plus d’erreur sur eclipse mais au moment où le mob spawn, le jeu crash
Le crash report:
:::–-- Minecraft Crash Report ---- // Uh... Did I do that? Time: 20/04/15 00:47 Description: Ticking entity java.lang.NullPointerException: Ticking entity at net.minecraft.item.ItemStack.getAttributeModifiers(ItemStack.java:889) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1803) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:684) at net.minecraft.world.World.updateEntity(World.java:2258) at net.minecraft.world.World.updateEntities(World.java:2108) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.item.ItemStack.getAttributeModifiers(ItemStack.java:889) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1803) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:684) at net.minecraft.world.World.updateEntity(World.java:2258) -- Entity being ticked -- Details: Entity Type: Kikoo (com.google.louisoryoan.mitnik.common.Kikoo) Entity ID: 550 Entity Name: Kikoo Entity's Exact location: 47,50, 72,00, 311,50 Entity's Block location: World: (47,72,311), Chunk: (at 15,4,7 in 2,19; contains blocks 32,0,304 to 47,255,319), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Entity's Momentum: 0,00, 0,00, 0,00 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2108) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) -- Affected level -- Details: Level name: test All players: 1 total; [EntityPlayerMP['Player187'/256, l='test', x=44,30, y=72,00, z=313,74]] Chunk stats: ServerChunkCache: 625 Drop: 0 Level seed: 8333636949232174397 Level generator: ID 00 - default, ver 1\. Features enabled: true Level generator options: Level spawn location: World: (63,64,316), Chunk: (at 15,4,12 in 3,19; contains blocks 48,0,304 to 63,255,319), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 120278 game time, 157783 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 104068 (now: false), thunder time: 44095 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 780159872 bytes (744 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 13 mods loaded, 13 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available CodeChickenCore{1.0.4.29} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available NotEnoughItems{1.0.3.74} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.3.74-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available me{1.3.1.2} [More Enchantments] (More-Enchantments-Mod-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mitnik{1.0.0} [Mod Mitnik] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available AencEx{0.0.1} [AencEx] (More-Enchantments-Mod-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticores{0.1} [Mystic Ores] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticruins{0.1} [Mystic Ruins] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticstones{0.2} [Mystic Stones] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticworld{0.1a} [Mystic World] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available VanillaPlus{1.4.4} [VanillaPlus] (VanillaPlus-1.7.10-1.4.4.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player187'/256, l='test', x=44,30, y=72,00, z=313,74]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
:::
-
@‘Yoan94’:
J’ai essayé ce que tu as dit
Je n’ai plus d’erreur sur eclipse mais au moment où le mob spawn, le jeu crash
Le crash report:
:::
–-- Minecraft Crash Report ---- // Uh... Did I do that? Time: 20/04/15 00:47 Description: Ticking entity java.lang.NullPointerException: Ticking entity at net.minecraft.item.ItemStack.getAttributeModifiers(ItemStack.java:889) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1803) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:684) at net.minecraft.world.World.updateEntity(World.java:2258) at net.minecraft.world.World.updateEntities(World.java:2108) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.item.ItemStack.getAttributeModifiers(ItemStack.java:889) at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1803) at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:250) at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2298) at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:684) at net.minecraft.world.World.updateEntity(World.java:2258) -- Entity being ticked -- Details: Entity Type: Kikoo (com.google.louisoryoan.mitnik.common.Kikoo) Entity ID: 550 Entity Name: Kikoo Entity's Exact location: 47,50, 72,00, 311,50 Entity's Block location: World: (47,72,311), Chunk: (at 15,4,7 in 2,19; contains blocks 32,0,304 to 47,255,319), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Entity's Momentum: 0,00, 0,00, 0,00 Stacktrace: at net.minecraft.world.World.updateEntities(World.java:2108) at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:515) -- Affected level -- Details: Level name: test All players: 1 total; [EntityPlayerMP['Player187'/256, l='test', x=44,30, y=72,00, z=313,74]] Chunk stats: ServerChunkCache: 625 Drop: 0 Level seed: 8333636949232174397 Level generator: ID 00 - default, ver 1\. Features enabled: true Level generator options: Level spawn location: World: (63,64,316), Chunk: (at 15,4,12 in 3,19; contains blocks 48,0,304 to 63,255,319), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 120278 game time, 157783 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 104068 (now: false), thunder time: 44095 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:703) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 780159872 bytes (744 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 13 mods loaded, 13 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available CodeChickenCore{1.0.4.29} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available NotEnoughItems{1.0.3.74} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.3.74-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available me{1.3.1.2} [More Enchantments] (More-Enchantments-Mod-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mitnik{1.0.0} [Mod Mitnik] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available AencEx{0.0.1} [AencEx] (More-Enchantments-Mod-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticores{0.1} [Mystic Ores] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticruins{0.1} [Mystic Ruins] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticstones{0.2} [Mystic Stones] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available mysticworld{0.1a} [Mystic World] (MysticMods-0.1(1.7.10).jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available VanillaPlus{1.4.4} [VanillaPlus] (VanillaPlus-1.7.10-1.4.4.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player187'/256, l='test', x=44,30, y=72,00, z=313,74]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
:::
C’est toujours mieux avec le code source pour savoir ce que tu as mis dans ton code et ce qui ne va pas.
-
La class de mon mob:
public class Kikoo extends EntityMob { public Kikoo(World world) { super(world); this.setCurrentItemOrArmor(0, new ItemStack(Mitnik.itemRubySword)); } public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.2D); } int d1 = this.rand.nextInt(8); int d2 = this.rand.nextInt(4); int d3 = this.rand.nextInt(4); protected void dropFewItems(boolean var1, int var2) { this.dropItem(Items.iron_ingot, d1); this.dropItem(Items.gold_ingot, d2); this.dropItem(Items.apple, d3); } protected void dropRareDrop(int par1){ this.dropItem(Items.emerald, 1); } }
-
@‘Yoan94’:
La class de mon mob:
public class Kikoo extends EntityMob { public Kikoo(World world) { super(world); this.setCurrentItemOrArmor(0, new ItemStack(Mitnik.itemRubySword)); } public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(1D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.2D); } int d1 = this.rand.nextInt(8); int d2 = this.rand.nextInt(4); int d3 = this.rand.nextInt(4); protected void dropFewItems(boolean var1, int var2) { this.dropItem(Items.iron_ingot, d1); this.dropItem(Items.gold_ingot, d2); this.dropItem(Items.apple, d3); } protected void dropRareDrop(int par1){ this.dropItem(Items.emerald, 1); } }
Et la classe principale ?
-
Voilà
public class Mitnik { @Instance("mitnik") public static Mitnik instance; @SidedProxy(clientSide = "com.google.louisoryoan.mitnik.proxy.ClientProxy", serverSide = "com.google.louisoryoan.mitnik.proxy.CommonProxy") public static CommonProxy proxy; public static final String MODID = "mitnik"; public static Item pommy; public static Item itemRubySword; @EventHandler public void preInit(FMLPreInitializationEvent event) { pommy = new pommy(20,0.8F,false).setUnlocalizedName("pommy").setTextureName("mitnik:pommy").setCreativeTab(CreativeTabs.tabFood); GameRegistry.registerItem(pommy, "pommy"); GameRegistry.addRecipe(new ItemStack(pommy), new Object[] {"#I ", " ", " ", '#', Items.apple, 'I', Items.diamond}); itemRubySword = GameRegistry.findItem("VanillaPlus", "rubySword"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); EntityRegistry.registerGlobalEntityID(Kikoo.class, "Kikoo", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB()); EntityRegistry.registerModEntity(Kikoo.class, "Kikoo", 420, this.instance, 40, 1, true); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
@‘Yoan94’:
Voilà
public class Mitnik { @Instance("mitnik") public static Mitnik instance; @SidedProxy(clientSide = "com.google.louisoryoan.mitnik.proxy.ClientProxy", serverSide = "com.google.louisoryoan.mitnik.proxy.CommonProxy") public static CommonProxy proxy; public static final String MODID = "mitnik"; public static Item pommy; public static Item itemRubySword; @EventHandler public void preInit(FMLPreInitializationEvent event) { pommy = new pommy(20,0.8F,false).setUnlocalizedName("pommy").setTextureName("mitnik:pommy").setCreativeTab(CreativeTabs.tabFood); GameRegistry.registerItem(pommy, "pommy"); GameRegistry.addRecipe(new ItemStack(pommy), new Object[] {"#I ", " ", " ", '#', Items.apple, 'I', Items.diamond}); itemRubySword = GameRegistry.findItem("VanillaPlus", "rubySword"); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); EntityRegistry.registerGlobalEntityID(Kikoo.class, "Kikoo", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB()); EntityRegistry.registerModEntity(Kikoo.class, "Kikoo", 420, this.instance, 40, 1, true); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Je suis en train de tester sur mon mode de test, je reviens quand j’ai la solution (5min environ).
EDIT : il faut mettre le code dans la fonction postinit car au moment de l’appel l’item n’est pas encore enregistré.
-
Pas besoin de faire tout un truc dans la classe principale :
public Kikoo(World world) { super(world); Item rubySword = GameRegistry.findItem("VanillaPlus", "rubySword"); if(rubySword != null) { this.setCurrentItemOrArmor(0, new ItemStack(Mitnik.itemRubySword)); } else { System.err.println("ruby sword from vanilla plus not found"); } }
Par contre ça ne fonctionnera pas si vanilla plus n’est pas installé. Et vérifie que les nom VanillaPlus et rubySword son bon, pour ça va sur un monde en créatif avec VanillaPlus installé et tapes la commande : /give <ton pseudo=“”>VanillaPlus:rubySword
Si tu reçois bien l’item c’est bon sinon c’est que le nom n’est pas le bon.
Pour trouver le bon :
/give <ton pseudo=“”>VanillaPlus: puis appuie sur la touche tab deux fois, la liste de tous les noms valides devrait apparaître. Si ce n’est pas le cas vérifie dans le menu mod (depuis le menu principale) le modid de VanillaPlus.</ton></ton> -
@‘robin4002’:
Pas besoin de faire tout un truc dans la classe principale :
public Kikoo(World world) { super(world); Item rubySword = GameRegistry.findItem("VanillaPlus", "rubySword"); if(rubySword != null) { this.setCurrentItemOrArmor(0, new ItemStack(Mitnik.itemRubySword)); } else { System.err.println("ruby sword from vanilla plus not found"); } }
Par contre ça ne fonctionnera pas si vanilla plus n’est pas installé. Et vérifie que les nom VanillaPlus et rubySword son bon, pour ça va sur un monde en créatif avec VanillaPlus installé et tapes la commande : /give <ton pseudo=“”>VanillaPlus:rubySword
Si tu reçois bien l’item c’est bon sinon c’est que le nom n’est pas le bon.
Pour trouver le bon :
/give <ton pseudo=“”>VanillaPlus: puis appuie sur la touche tab deux fois, la liste de tous les noms valides devrait apparaître. Si ce n’est pas le cas vérifie dans le menu mod (depuis le menu principale) le modid de VanillaPlus.</ton></ton>Si tu veux que VanillaPlus soit obligatoirement installé, il faut mettre dependencies=“required-after:VanillaPlus” dans l’annotation @Mod.