Topic category: Help with modding (Java Edition)
Hey guys, sorry I'm a bit new to all of this, but I have been searching and searching everything I can find to figure out a way to do this.
I want to check/replace every single slot in a chest and then replace a specific item, if found, with another item. To do this, I have a some code laid out to check if it is raining (one of the dependencies I need for this) and if the item is in slot 0-36 of a "chest" block. Being able to create a range would make it so I don't have to repeat the same block of code 36 times in a row, changing only one number.
I don't know how to insert an image, but here's what I've done so far:
if [[is raining in the provided world]AND[[get item from slot 0 of currently open GUI of [event target entity]] = [certain item]]]
do [clear slot 0 of block at x y z if it has inventory]
[set 1 [certain other item] in slot 0 of block at x y z if it has inventory]
And after writing that out, I realized I don't want the GUI to have to be open in order for this change to take place
ANY HELP WOULD BE VERY VERY APPRECIATED!!! I've been searching for DAYS on end!