Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Kragast

Members
  • Joined

  • Last visited

Everything posted by Kragast

  1. Why? There is no server key-bindings
  2. It does nothing. Why? @Mod.EventBusSubscriber(modid = Mod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ClientEventsHandler { @OnlyIn(Dist.CLIENT) @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { System.out.println(event.getKey()); System.out.println("Key is down!"); Mod.LOGGER.info("Key is down!"); Mod.LOGGER.info(event.getKey()); } }
  3. Yes, it is so. Now I don't understand, how then I can connect Client-Side-Keyboard-Input with server interactions. Should I send packages?
  4. Because I want to setRenderViewEntity to my dummy entity. When I place the block in my world, it works. @Mod.EventBusSubscriber(modid = FreeCam.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvents { @SubscribeEvent public static void onKeyPress(InputEvent.KeyInputEvent event) {} }
  5. And another question. I'm writing one-side client mode, that changes camera position. And I'd like it to work on servers. This is why I think, I need to summon it in client side.
  6. I've copied vanilla code and then my minecraft crashed How can I summon entity in specific coordinates? I could change this later, but addEntity returns boolean, not Entity.
  7. I need to spawn an entity in the world, but i can't found any information how to do this in 1.16.4. I tryed with a pig, but i couldn't :(( Tell me, please, how to do that @SubscribeEvent public static void onKeyPress(InputEvent.KeyInputEvent event) { int key = event.getKey(); int action = event.getAction(); if ((key == 93) && (action == 1)) { System.out.print("KEY IS DOWN!\n"); PlayerEntity player = Minecraft.getInstance().player; World world = player.getEntityWorld(); world.setBlockState(player.getPosition().add(0, -1, 0), Block.getStateById(1)) // spawn a mob here } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.