Sign in to follow this
Followers
0

Server Upgrades & Minor Downtime
By
Guest Mr. Flamegoat, in Site News (non-forge)
-
Recently Browsing
No registered users viewing this page.
-
Posts
-
By diesieben07 · Posted
The correct event for this check is ClientTickEvent. Make sure to check TickEvent#phase. -
By diesieben07 · Posted
Yeah, it would be better to just lazily initialize the values in the capability. However AttachCapabilitiesEvent is triggered directly from the ItemStack constructor. So it is impossible to have an ItemStack object and not have AttackCapabilitiesEvent fire for it. -
By Beethoven92 · Posted
They are basically the same. With the annotation method you can also specify the Dist where this event handler will be loaded on. What is wrong with your code is that your method is not declared as static. Take a look here for more info on events: https://mcforge.readthedocs.io/en/latest/events/intro/ -
Hey there, I'm trying to setup a basic keybinding, but I can't seem to get the event to fire. Here's my code for subscribing to the event: @Mod.EventBusSubscriber public class ModKeyInputs { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if (ModKeyBindings.OPEN_DIVINE_FAVOUR_RELATIONSHIP.isPressed()) { Minecraft.getInstance().displayGuiScreen(new DivineFavourRelationshipsScreen(Minecraft.getInstance().player)); } } } Now I've put a breakpoint in the method there at the start, and I can never get it to fire. Am I subscribing to this event incorrectly? As a side note, is there much difference between using @Mod.EventBusSubscriber on a class versus MOD_EVENT_BUS.register(ModKeyInputs.class); in the constructor of the main mod class?
-
Topics
-
Who's Online (See full list)