Page 1 of 1

[Question] global version of on use

Posted: Tue Feb 25, 2020 22:58
by Extex
Is there some way to detect when a player is using an item and stop it. (Under certain conditions)

Re: [Question] global version of on use

Posted: Wed Feb 26, 2020 00:19
by sorcerykid
You could override the minetest.register_craftitem() function, and hook into the on_use callback. Take a look at my Antigrief mod for a basic example of the methodology:

https://bitbucket.org/sorcerykid/antigrief/src/master/init.lua