315Lukas Posted February 4, 2017 Posted February 4, 2017 Hello all. I'm trying to find a way to tell if the player broke a block client-side - any block at all. I've tried using BlockEvents.BreakEvent but that appears to be server-side only... (isRemote only returns false, never true) It's for rendering stuff, so I really don't want to send packets every time the player breaks a block... has anyone got any ideas? Quote
315Lukas Posted February 4, 2017 Author Posted February 4, 2017 I wanted to draw some particles (but I don't understand why this matters?) Quote
315Lukas Posted February 4, 2017 Author Posted February 4, 2017 Okay, but how could I do this for every block? Quote
315Lukas Posted February 4, 2017 Author Posted February 4, 2017 I don't want to modify, I only want to add stuff Quote
315Lukas Posted February 5, 2017 Author Posted February 5, 2017 (edited) Thanks, I got it working now: public void playEvent(EntityPlayer player, int code, BlockPos pos, int blockId) { EntityPlayerSP realPlayer = Minecraft.getMinecraft().thePlayer; if (code == 2001 && player == null && realPlayer != null && realPlayer.getDistanceSq(pos) < 46 && realPlayer.rayTrace(4.5, 0).getBlockPos().equals(pos) && realPlayer.isSwingInProgress) { // 50 == 5 blocks (max. 4) this.blockBroken = true; } } Edited February 5, 2017 by 315Lukas Code improvements Quote
Recommended Posts
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.