Blockland Forums
Home
Help
Login
Register
Blockland Forums
»
Blockland Forums
»
Modification Help
»
Detecting if a player's inventory has changed?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Detecting if a player's inventory has changed? (Read 1162 times)
TheViewer
May 29, 2018, 03:44:38 AM
Is there any kind of callback function for when a player's inventory has been changed (e.g. through the setInventory event)? If not, what would be an ideal way to determine this?
Ad Bot
Advertisement
Conan
May 29, 2018, 11:58:46 AM
theres no callback when an inventory changes. two of your options include:
run a schedule loop on a player checking their %player.tool[%i] slots for changes
packaging armor::onCollision, giveDefaultInventory, cleartools, gameconnection::spawnplayer, etc (aka all functions that give/remove players items)
i dont know if theres any other way to do this other than the methods above. id personally go with the schedule loop cause packaging will involve a stuff ton of functions and probably break a bunch of mods. you can safely run the loop very fast since its just value comparisons, which wont lag the server significantly
Print
Pages: [
1
]
« previous
next »
Blockland Forums
»
Blockland Forums
»
Modification Help
»
Detecting if a player's inventory has changed?