Posted March 18, 20187 yr Hi. I am trying to instantly break a block when the player left clicks on it with a specific tool. I am definitely registering the event in the event bus. Any help would be greatly appreciated. public class EventVoidMultitoolBlock { @SubscribeEvent public void onPlayerInteract(PlayerInteractEvent.LeftClickBlock event) { if (event.getItemStack() == new ItemStack(ModTools.VOID_MULTITOOL)) { BlockPos pos = event.getPos(); event.getWorld().setBlockToAir(pos); } } } My username elsewhere is Fluoride
March 18, 20187 yr Author I changed if (event.getItemStack() == new ItemStack(ModTools.VOID_MULTITOOL)) to if (event.getItemStack().getItem() == ModTools.VOID_MULTITOOL) and now it works My username elsewhere is Fluoride
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.