My minecraft is crashing with custom code

Started by RodizzGamer on Wed, 10/21/2020 - 11:03

Topic category: Advanced modding

Last seen on 20:30, 14. Nov 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
My minecraft is crashing with custom code
Tue, 11/24/2020 - 08:57 (edited)

I am making that when the player clicks the button send a message to the chat but the games crashes

 

here is the function 

@SubscribeEvent
public static void playerTick(TickEvent.PlayerTickEvent event) {
    if (RegistryHandler.keys[0].isPressed() && RegistryHandler.keysStates[0] == false) {
        ExampleMod.LOGGER.info("NINJA CARD");
        ((ServerPlayerEntity)event.player).func_241151_a_(new TranslationTextComponent("NinjaCard"), ChatType.CHAT, Util.field_240973_b_);
        RegistryHandler.keysStates[0] = true;
    }
    else if(RegistryHandler.keys[0].isPressed()) {
        RegistryHandler.keysStates[0] = false;
    }
}
Edited by RodizzGamer on Tue, 11/24/2020 - 08:57
Last seen on 19:31, 25. Nov 2020
Joined Apr 2010
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
This seems like custom code…
Wed, 10/21/2020 - 19:25

This seems like custom code. Learn how to code if you want to use custom code.

Last seen on 20:30, 14. Nov 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ok   
Thu, 10/22/2020 - 08:01

ok 

 

Last seen on 20:30, 14. Nov 2020
Joined May 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
What i do to not crash the…
Thu, 10/22/2020 - 08:25

What i do to not crash the game 

 

Last seen on 19:21, 24. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Learn how to code if you…
Thu, 10/22/2020 - 12:40

Learn how to code if you want to use custom code.