[SOLVED]Custom element code to animate bow and shield crashes server startup but works fine in singleplayer

Started by KentukySS on

Topic category: Troubleshooting, bugs, and solutions

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[SOLVED]Custom element code to animate bow and shield crashes server startup but works fine in singleplayer
Tue, 02/07/2023 - 20:49 (edited)

It looks like using custom element code to play shield and bow animation causes server start to crash.

I've looked in several threads on the forum and I haven't found a solution, please help.

 

Also, the custom arrow returns the normal arrow, but this is a different topic.

 

BTW, this is how you animate your custom bow and shield for MC 1.19.2, I'll make a tutorial in the future when I have more time and this bug no longer occurs.


Crash report and java codes:

https://gist.github.com/KentukySG/b27411fb1250ab2322c02b9c4f1c8e0b

Here is two videos showing the animation with and without the custom code:

https://imgur.com/a/0eL1pRg

Edited by KentukySS on Tue, 02/07/2023 - 20:49
The problem here is that you…
Mon, 02/06/2023 - 13:23

The problem here is that you are trying to add client properties through the server. Item properties like blocking for shields should be registered during client setup.

Also, you are for some reason creating an instance of the class which loads the properties, which is not needed.

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So you're telling me not to…
Tue, 02/07/2023 - 12:34

So you're telling me not to use the xxItemProperties.java?

 

What should I do? Because without them the animation of bows and shields is broken

No, what I'm telling you is…
Tue, 02/07/2023 - 14:04

No, what I'm telling you is that you only need to subscribe to the client setup event to load the properties, you don't need to do anything else.

@Mod.EventBusSubscriber(bus …
Tue, 02/07/2023 - 14:07
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public class CustomSetupManager {



		@SubscribeEvent
		public static void clientLoad(final FMLClientSetupEvent event) {
			SartoriumBowItemProperties.addCustomItemProperties();
			GoldShieldItemProperties.addCustomItemProperties();
		}

}
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just tested your code and…
Tue, 02/07/2023 - 20:48

I just tested your code and it worked, now the server starts with the mod, thank you so much :)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@KentukySS Can you explain…
Fri, 03/22/2024 - 21:11

@KentukySS 
Can you explain to me how you animated the shield?