Posted March 30, 201510 yr Hi, I'm looking to replace the vanilla which is placed by bucket in my custom dimension. So I first looked how vanilla does with the water in the nether and they do by a method in ItemBucket which I obviously can't edit. So I looked at Forge events for some answers and I came across the PlayerInterectEvent so this is what I've came up. I've just tried cancelling the interaction at first but it doesn't seem to work. But it gets called and If I try it with a torch it gets cancelled so Im not sure what Im doing wrong here. Heres the code: @SubscribeEvent public void playerInteract(PlayerInteractEvent event) { ItemStack hand = event.entityPlayer.inventory.getCurrentItem(); if(event.entityPlayer != null && hand != null) { if(event.entityPlayer.dimension == 3 && hand.getItem() == Items.water_bucket) { if(event.action == event.action.RIGHT_CLICK_BLOCK) { System.out.println("call"); event.useItem = Result.DENY; event.setCanceled(true); //event.world.setBlock(event.x, event.y, event.z, ACBlocks.frostWaterIce); } } } }
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.