Monture apprivoisable par 1 personne
-
“entityName.setLocationAndAngles(x, y, z, this.rotationYaw, 1.0F);” remplace ça par entityName.setPosition(x, y, z);
-
@‘Superloup10’:
C’est ça, vérifie bien que tu as tous les paramètres de onItemRightClick en mettant @Override dessus.
Quand je mais le @Override il me dit de l’enlever
-
Cela veux dire que la méthode est incorrecte, regarde dans la class Item pour trouver la bonne méthode.
-
@‘Superloup10’:
Cela veux dire que la méthode est incorrecte, regarde dans la class Item pour trouver la bonne méthode.
C’est les int
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) { return p_77659_1_; }Mais si je les enleves j’ai cette erreur logique
entityName.setPosition(x, y, z); -
Regarde si tu peux faire ```java
entityName.setPosition(world.getX(), world.getY(), world.getZ()); -
@‘Superloup10’:
Regarde si tu peux faire ```java
entityName.setPosition(world.getX(), world.getY(), world.getZ());non plus
-
Essaye sans cette méthode, alors.
-
@‘Superloup10’:
Essaye sans cette méthode, alors.
J’ai essayé le probleme il spawn pas
-
C’est onItemUse la bonne fonction.
-
Voilà avec onItemUse se que sa me fait sa spawn toujours pas
@Override public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { EntityDragonDindeSauvage entityName = new EntityDragonDindeSauvage(world); entityName.setTamed(true); // Le nom de la méthode peut différer d'une version de Minecraft à l'autre entityName.func_152115_b(player.getUniqueID().toString()); // Le joueur est obtenu grâce à la méthode. entityName.setPosition(x, y, z); world.spawnEntityInWorld(new EntityDragonDindeSauvage(world)); // Même chose que le commentaire précédent return false; }J’ai ajouté un System.out.print(“spawn”); est sa l’ecrie bien dans la console
Edit: c’est bon il spawn j’ai fait comme sa je vais test en multi si tous marche
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (world.isRemote) { return true; } EntityDragonDindeSauvage entityName = new EntityDragonDindeSauvage(world); entityName.setTamed(true); // Le nom de la méthode peut différer d'une version de Minecraft à l'autre entityName.func_152115_b(player.getUniqueID().toString()); // Le joueur est obtenu grâce à la méthode. entityName.setPosition(x, y, z); //world.spawnEntityInWorld(new EntityDragonDindeSauvage(world)); // Même chose que le commentaire précédent world.spawnEntityInWorld(entityName); System.out.print("spawn"); return true; }Le crash en multi
---- Minecraft Crash Report ---- // Why did you do that? Time: 5/19/16 9:20 PM Description: Exception in server tick loop java.lang.NoSuchMethodError: fr.darkvince.facrpg.monture.EntityDragonDindeSauvage.func_152115_b(Ljava/lang/String;)V at fr.darkvince.facrpg.oeufDragonDinde.func_77648_a(oeufDragonDinde.java:37) at net.minecraft.item.ItemStack.func_77943_a(ItemStack.java:169) at net.minecraft.server.management.ItemInWorldManager.func_73078_a(ItemInWorldManager.java:487) at net.minecraft.network.NetHandlerPlayServer.func_147346_a(NetHandlerPlayServer.java:869) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:60) at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.func_148833_a(SourceFile:9) at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:206) at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:173) at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:953) at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:432) at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:783) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646) at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Linux (amd64) version 3.5.0-47-generic Java Version: 1.8.0_60, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 109466816 bytes (104 MB) / 349081600 bytes (332 MB) up to 10416029696 bytes (9933 MB) JVM Flags: 23 total; -Xmx10000M -Xms256M -XX:MaxPermSize=256m -XX:PermSize=128m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=50 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts AABB Pool Size: 1467 (82152 bytes; 0 MB) allocated, 426 (23856 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94 FML: MCP v9.03 FML v7.2.217.1147 Minecraft Forge 10.12.2.1147 5 mods loaded, 5 mods active mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.2.217.1147} [Forge Mod Loader] (cauldron-1.7.2-1.1147.04.98-server.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.12.2.1147} [Minecraft Forge] (cauldron-1.7.2-1.1147.04.98-server.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available facrpg{1.0} [facrpg] (facrpg-1.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available ModCustomMenu{1.0} [ModCustomMenu] (facrpg-1.0.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 34 (1904 bytes; 0 MB) allocated, 6 (336 bytes; 0 MB) used Player Count: 1 / 100; [EntityPlayerMP['darkvince_'/36, l='world', x=-10.13, y=63.00, z=122.09](darkvince_ at -10.133819263271905,63.0,122.09285613271233)] Is Modded: Definitely; Server brand changed to 'cauldron,craftbukkit,mcpc,fml,forge' Type: Dedicated Server (map_server.txt) -
La fonction func_152115_b est surement en @SideOnly(Side.CLIENT)
-
@‘robin4002’:
La fonction func_152115_b est surement en @SideOnly(Side.CLIENT)
Bonne nouvelle sa crash plus probleme il spawn plus
-
La fonction est toujours appelé ?
-
@‘robin4002’:
La fonction est toujours appelé ?
Oui car elle marche en solo
-
Ton entité est bien enregistré sur les deux côtés et pas uniquement sur le client ?
-
@‘robin4002’:
Ton entité est bien enregistré sur les deux côtés et pas uniquement sur le client ?
Le truc c’est que avec l’oeuf normal il spawn bien
Edit: J’ai pu remarquer que en enlevant
@SideOnly(Side.CLIENT)
entityName.func_152115_b(player.getUniqueID().toString());Il spawn
-
Personne c’est pourquoi sa fait sa
[font=Ubuntu, sans-serifQuand j’enleve]
[font=Ubuntu, sans-serif@SideOnly(Side.CLIENT)]
[font=Ubuntu, sans-serif entityName.func_152115_b(player.getUniqueID().toString()); ][font=Ubuntu, sans-serifIl spawn]
-
Elle fait quoi la fonction func_152115_b ?
-
@‘robin4002’:
Elle fait quoi la fonction func_152115_b ?
Rien du tous
package fr.darkvince.facrpg; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fr.darkvince.facrpg.monture.EntityDragonDindeSauvage; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class oeufDragonDinde extends Item{ // @SideOnly(Side.CLIENT) public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if (world.isRemote) { return true; } EntityDragonDindeSauvage entityName = new EntityDragonDindeSauvage(world); entityName.setTamed(true); // Le nom de la méthode peut différer d'une version de Minecraft à l'autre // entityName.func_152115_b(player.getUniqueID().toString()); // Le joueur est obtenu grâce à la méthode. entityName.setPosition(x, y, z); world.spawnEntityInWorld(new EntityDragonDindeSauvage(world)); // Même chose que le commentaire précédent world.spawnEntityInWorld(entityName); return true; } } -
world.spawnEntityInWorld(new EntityDragonDindeSauvage(world));
Cette ligne ne devrait pas être là, il ne devrait avoir que la deuxième.Ton mob est bien enregistré dans la classe principale ?
