How to get the item the player is holding?
-
module.on("update", function() { //if held item = map ( // commandManager.executeCommands(".toggle trigger off") //) // })
-
@vol1n mc.thePlayer.getHeldItem()
-
@czechhek What does the getHeldItem() function return?
-
@vol1n if (mc.thePlayer.getHeldItem().getItem() instanceof ItemMap) {}
-
module.on("update", function() { if (mc.thePlayer.getHeldItem().getItem() instanceof ItemMap) { commandManager.executeCommands(".toggle trigger off") } })
Any idea why this didn't work?
-
@idk-my-name Also, is there any documentation on the mc.thePlayer class?
-
-
@chodeman executeCommand without s at the end