Started by
lunakel_
on
Topic category: Help with MCreator software
How can I make it so that when an item is in the Hotbar, it gives the player an effect? Perhaps I made a mistake in the question, sorry my English is not very good
Topic category: Help with MCreator software
How can I make it so that when an item is in the Hotbar, it gives the player an effect? Perhaps I made a mistake in the question, sorry my English is not very good
You can do the procedure to check the hotbar slots and if the item exists give an effect. I'm not on my PC right now, if you don't or others don't, I'll send you a screenshot of what it looks like.
0 through 8 are the hotbar slots
you then wrap it up it or statements so it checks them all
http://www.mediafire.com/file/q3tteqemuwu539j/itembonus.ptpl/file
Rather than having to copy and paste the same thing 9 times like Kinyoshi suggests, you can actually just use a loop to check all the slots. Print statements added for clarity (they are not needed to work).
The way I demonstrate below also stops checking other slots if the item is already found, so that the game doesn't spend extra time looking