[Feature request] has_inventory
cypher139 opened this issue ยท 0 comments
A has_inventory(specifier) function would be helpful to have available, as get_inventory_size() and other related inventory functions throw an exception if the block location / entity given does not have an inventory.
While try() does work to avoid the exception, checking the specifier for available inventory in the first place might be a better idea.
Example: player_interact bind checking inventory size and type of a interacted block, expecting to just refuel a furnace: having a non-inventory item given to these inventory functions might happen more often than expected as players go about their day clicking on nearly anything.