[Question] global version of on use

Post Reply
User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

[Question] global version of on use

by Extex » Post

Is there some way to detect when a player is using an item and stop it. (Under certain conditions)
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
sorcerykid
Member
Posts: 1847
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Question] global version of on use

by sorcerykid » Post

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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests