utils
A handful of utils to interact with the API.
Drop Table
Drops the table item from tables registry.
from ID
data modify storage rcore:api find set value "TABLE_ID"
function rcore:crafting_table/dropfrom Entity
execute as @e[type=marker, tag=rcore_crafting_table, limit=1] at @s run function rcore:crafting_table/dropCreate Table
Sets the table block at the target location from tables registry.
from ID
data modify storage rcore:api find set value "TABLE_ID"
function rcore:crafting_table/createfrom Entity
execute as @e[type=marker, tag=rcore_crafting_table, limit=1] at @s run function rcore:crafting_table/createDestroy Table
Removes this table and drops itself.
from Entity
execute as @e[type=marker, tag=rcore_crafting_table, limit=1] at @s run function rcore:crafting_table/destroySelect Table
Select the table.
INFO
tag selector cannot have : which is why we use the nbt selector instead.
execute as @e[type=marker, tag=rcore_crafting_table, nbt={Tags: ["TABLE_ID"]}] at @s run ...
# Example
execute as @e[type=marker, tag=rcore_crafting_table, nbt={Tags: ["rcore:custom_crafting_table"]}] at @s run setblock ~ ~1 ~ diamond_blockGet Total Tables
Returns the total number of registered tables.
scoreboard players get #Tables rcore.utilDrop Item
Drops the item from items registry.
data modify storage rcore:api find set value "ITEM_ID"
function rcore:items/dropSelect Item
Select the item from items registry.
INFO
tag selector cannot have : which is why we use the nbt selector instead.
execute as @e[type=item, tag=rcore_item, nbt={Tags: ["ITEM_ID"]}] at @s run ...
# Example
execute as @e[type=item, tag=rcore_item, nbt={Tags: ["rcore:recipe_book_table"]}] at @s run say RECIPE BOOK ITEMGet Total Items
Returns the total number of registered items.
scoreboard players get #Items rcore.utilExecute Recipes
Checks if the table matches any recipes. If it does match a recipe drop the result(s)
from Entity
execute as @e[type=marker, tag=rcore_crafting_table, limit=1] at @s run function rcore:recipes/executeGet Last Recipe
Returns a String which is the ID of the last crafted recipe.
from Entity
execute as @e[type=marker, tag=rcore_crafting_table, limit=1] at @s run data get entity @s data.last_recipeGet Total Recipes
Returns the total number of registered recipes.
scoreboard players get #Recipes rcore.utilSelect Result Items
Select the result item.
INFO
tag selector cannot have : which is why we use the nbt selector instead.
execute as @e[type=item, tag=rcore_result, nbt={Tags: ["RECIPE_ID"]}] at @s run ...
# Example
execute as @e[type=item, tag=rcore_result, nbt={Tags: ["rcore:recipe_book_table"]}] at @s run say CRAFTED RECIPE BOOK TABLE