Item Filter Scripting (1.13) - mcenderdragon/Futurepack-API GitHub Wiki
You can use JavaScript to create advancet item filters which can do tons of stuff. (Like only bees with certain stats are allowed).
function filterItem(item)
{
return item.getRegisteredName() == "minecraft:stick";
}
function transferItemCallback(item)
{
//this is just a callbakc for every item transfered
}
Every item has the following functions:
returns an integer, how many item are there
returns a String representing the name e.g. "minecraft:stick"
The extra data of this item, can be null
Bindings are directly accessible from JavaScript
Example:
the NBTTag is: {"display": { "text": "Sword" } }
from JavaScript you can access it like this:
print(item.getNBT().display.text)}
The output would be:
Sword
returns true if this Item has extra data
returns a float representing the amount this item can smelt, if 0 is returned no items can be melted
returns true is this item is "empty" as in 0 stack size or an "air" item.
returns the max amoutn of item you can stack, often 64.
returns the amount of damage this item already took.
returns The max amount of damage this tool can take, if 0 then this item is not damageable
returns true if this item is in the given tag
Short for
helper_tags.hasTag(iitem, "forge:ores")
Short for
helper_tags.hasTag(iitem, "forge:ingots")
Short for
helper_tags.hasTag(iitem, "forge:dusts")
returns all tags associated with this item