TriggerReactor

TriggerReactor

24.6k Downloads

Add placeholders to check if a player has an item

gerzytet opened this issue · 2 comments

commented

It will be split up into 2 placeholders
(The names are not final. Change them if you have something better)
$countitem:{item}
Finds the item in the player’s inventory and returns how many of that item that they have.
$locateitem:{start}:{item}
Searches for the item in the players inventory and returns the lowest index that contains the item.
If start is specified, the search will begin at that index.
If the item could not be found, returns -1.

In both placeholders, {item} is either an ItemStack or a String representing an item id. If item is an ItemStack, the placeholder should look for items that are stackable with items in the inventory. Otherwise, it should look for any item with the same material. For sponge, whether 2 items are stackable can be determined with this

commented

@rkdrns4747
are these commits merged?

commented

@wysohn no it's on executors_and_placeholders_work branch still. I planned to merge this with #GIVE improvement. #238