-
[SOLVED] How can I do somehing with Keybindings?
Thanks to everyone.
-
[SOLVED] How can I do somehing with Keybindings?
I GOT IT TO WORK!!! I registered the ModPacketHandler in my main class and it workend. (In the private void setup)
-
[SOLVED] How can I do somehing with Keybindings?
This is about the registering of the ModPacketHandler
-
[SOLVED] How can I do somehing with Keybindings?
I think the problem is that the default dist is client and it never gets registered on the server.
-
[SOLVED] How can I do somehing with Keybindings?
Wait. Is this Right? @Mod.EventBusSubscriber(modid = UltimateSheepMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
-
[SOLVED] How can I do somehing with Keybindings?
Can I post a zip file of the mod?
-
[SOLVED] How can I do somehing with Keybindings?
So I should make my mod a git project? Like the Folder or the folder where the mod folder is?
-
[SOLVED] How can I do somehing with Keybindings?
What? I never used Github How?
-
[SOLVED] How can I do somehing with Keybindings?
It crashed. crash-2021-05-23_20.00.52-client.txt latest.log
-
[SOLVED] How can I do somehing with Keybindings?
Ok
-
[SOLVED] How can I do somehing with Keybindings?
Can I just do it twice? EDIT: Like on Server and on the Client in the two classes?
-
[SOLVED] How can I do somehing with Keybindings?
You mean like ModServerEvent?
-
[SOLVED] How can I do somehing with Keybindings?
@Mod.EventBusSubscriber(modid = UltimateSheepMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvent { @SubscribeEvent public static void lightning(AttackEntityEvent event){ if(event.getEntityLiving().getHeldItemMainhand().getItem() == ModItems.LIGHTNING_HAMMER.get()){ LightningBoltEntity lightning = new LightningBoltEntity(EntityType.LIGHTNING_BOLT,event.getEntity().world); lightning.setPosition(event.getTarget().getPosX(), event.getTarget().getPosY(), event.getTarget().getPosZ()); event.getPlayer().world.addEntity(lightning); } } @SubscribeEvent public static void onCrafting(GuiOpenEvent event){ if (event.isCancelable()){ if (event.getGui() instanceof CraftingScreen){ if (event.getResult().equals(Items.APPLE)){ event.setCanceled(true); } } } } @SubscribeEvent public static void fly(TickEvent.ClientTickEvent event){ if(event.phase == TickEvent.Phase.START){ if(UltimateSheepMod.KEY.isKeyDown()){ ModPacketHandler.simpleChannel.sendToServer(new FlyActivateMessage()); } } } @SubscribeEvent public static void doClientSetup(FMLClientSetupEvent event){ ClientRegistry.registerKeyBinding(UltimateSheepMod.KEY); } @SubscribeEvent public static void doCommonSetup(FMLCommonSetupEvent event){ ModPacketHandler.init(); }
-
[SOLVED] How can I do somehing with Keybindings?
Here the Crash report. crash-2021-05-23_19.08.29-client.txt
-
[SOLVED] How can I do somehing with Keybindings?
latest.log
IPS spam blocked by CleanTalk.