My mod crashed the server when I made one of my new armor piece

Started by CharizardG on

Topic category: Help with Minecraft modding (Java Edition)

Active 3 years ago
Joined Jul 2018
Points:
697

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
My mod crashed the server when I made one of my new armor piece
Sun, 07/22/2018 - 15:24 (edited)

Here is what I got from the server

net.minecraft.util.ReportedException: Ticking player at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:459) ~[oq.class:?] at net.minecraft.network.NetHandlerPlayServer.func_73660_a(NetHandlerPlayServer.java:173) ~[pa.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.func_73660_a(NetworkDispatcher.java:209) ~[NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:285) ~[gw.class:?] at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:180) [oz.class:?] at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:790) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) [nz.class:?] at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_172] Caused by: java.lang.NoSuchMethodError: net.minecraft.entity.player.InventoryPlayer.func_70440_f(I)Lnet/minecraft/item/ItemStack; at mod.mcreator.mcreator_supremeArmor$2.func_77663_a(mcreator_supremeArmor.java:93) ~[mcreator_supremeArmor$2.class:?] at net.minecraft.item.ItemStack.func_77945_a(ItemStack.java:526) ~[aip.class:?] at net.minecraft.entity.player.InventoryPlayer.func_70429_k(InventoryPlayer.java:363) ~[aec.class:?] at net.minecraft.entity.player.EntityPlayer.func_70636_d(EntityPlayer.java:511) ~[aed.class:?] at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2170) ~[vp.class:?] at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:234) ~[aed.class:?] at net.minecraft.entity.player.EntityPlayerMP.func_71127_g(EntityPlayerMP.java:382) ~[oq.class:?] ... 9 more

 

Here is the code: https://pastebin.com/RmPhWjE3

It breaks the server when I made the chestplate

Edited by CharizardG on Sun, 07/22/2018 - 15:24
You most likely used some…
Mon, 07/23/2018 - 20:28

You most likely used some intense event in the update tick trigger such as explode on the armor, which caused Minecraft to crash.

Active 3 years ago
Joined Jul 2018
Points:
697

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
It was armor that allowed me…
Tue, 07/24/2018 - 00:06

It was armor that allowed me to fly

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
The actual reason why is…
Tue, 07/24/2018 - 00:49

The actual reason why is this happening is that InventoryPlayer#armorItemInSlot() (or if you want the obfuscated name  InventoryPlayer#func_70440_f()) is actually client only method, but in the code, it is run from common code - so on both server and client. Because of this the server can not find the method and throws java.lang.NoSuchMethodError resulting in the crash. The correct way for getting an armor ItemStack, in this case, should be using EntityLivingBase#getItemStackFromSlot()

Active 3 years ago
Joined Jul 2018
Points:
697

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
Thank you
Tue, 07/24/2018 - 04:02

Thank you

Active 3 years ago
Joined Jul 2018
Points:
697

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 6
Can you give an example of…
Tue, 07/24/2018 - 04:19

Can you give an example of that code, that will help me and my phone glitched with all the thank yous