Posted July 15, 20205 yr i want to add a trident at player position but nothing happen. @SubscribeEvent public void onClientTickEvent(final TickEvent.ClientTickEvent event) { if(event.phase != TickEvent.Phase.END) return; Minecraft minecraft = Minecraft.getInstance(); if(minecraft.player == null) return; PlayerEntity player = minecraft.player; ItemStack mainHand = player.getHeldItemMainhand(); if(KeyBindingHandler.throw_saber.isPressed() && mainHand.getItem() instanceof BeamSaber) { TridentEntity trident = new TridentEntity(minecraft.world,player,mainHand); minecraft.world.addEntity(trident); } }
July 15, 20205 yr You can't add an entity from the client, you have to use another event, for instance the PlayerTickEvent.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.