• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to disable block interaction?

onion_hq

New member
Joined
Dec 23, 2023
Messages
13
Reaction score
0
How do I stop players from interacting with blocks (flipping trap/doors, opening chests and barrels, accessing crafting tables)?
 

pixlii

Forum adept
Overlord
Joined
May 20, 2021
Messages
225
Reaction score
35
you can use GAME EVENT: Cancel Event on PLAYER EVENT: Right Click to cancel any right click effects
 

onion_hq

New member
Joined
Dec 23, 2023
Messages
13
Reaction score
0
you can use GAME EVENT: Cancel Event on PLAYER EVENT: Right Click to cancel any right click effects
Ok it works, but it took me a second to realize how to actually implement it, mainly because my game uses Right Clicks for key parts so I was thinkin "wouldn't that just completely break this part?" but then I figured out if I put it at the end of the Right Click line it would still activate all the functions then stop the RC from affecting the world.
 

pixlii

Forum adept
Overlord
Joined
May 20, 2021
Messages
225
Reaction score
35
actually, cancel event only cancels default world interactions- the code that you set will be unaffected by it
 
Top Bottom