#Cancel Right Click Event

15 messages · Page 1 of 1 (latest)

autumn stirrup
#

The documentation info about cancelling a right click event is pretty confusing, so I am going to describe the thing I want done because I do not even know if its possible.

In the Mutant Mobs mod, there is an item called a Creeper Shard, that when Right Clicked, will cause an explosion. The problem with this is that it breaks blocks, even if they are claimed by the FTB Mods, and we do not wan't this on our server.

Using Event Cancelling I have already turned off certain commands in certain dimension, and stopped a type of mob from spawning, but the thing I do not know is that if you can cancel something like an item interaction. If it helps the item has a cooldown like an enderpearl or chorus fruit, so it seems like a basic item interaction to me.

fresh sunBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

subtle pebble
#

try

ItemEvents.firstRightClicked(event=>{})
#

use this to check the item and cancel it if it's what you want to prevent

autumn stirrup
#

Could you write an example of what the full script item would be? Sorry, I wasn’t more specific and I haven’t messed around with Kube too often, I just followed the code given to me

#

If it’s helpful it could just be an example with like canceling an ender pearl or some other vanilla item, and I can see if I can then edit and and make it work for the item

subtle pebble
autumn stirrup
#

Thanks, I’ll give it a test out here in a moment

autumn stirrup
#

I will have to test it more tomorrow because my power just went out lmao, but before it did, it loaded, there were no errors, but ender pearls were still able to be thrown

#

I will do some more testing tomorrow on the actual server and see if there's anything new

#

Thank you for any help you shoot my way, its all super appreciated

subtle pebble
autumn stirrup
#

That worked thank you

#

Now to see if it works with the creeper shard

#

It worked! Thank you