Jump to content

Kragast

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Kragast's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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 } }
×
×
  • Create New...

Important Information

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