Feature
- Add function hooks. A hook is a special location in a function that allows for external commands to be inserted for customization purposes. It differs from the usual
append
and prepend
operations as it's possible to create a hook anywhere, including between nested commands. Use the Hook
API to create and use function hooks. (060c78c
)
from integrity import Hook
function ./load:
say Loading data pack.
Hook.create("load")
as @a[tag=!first_load]:
Hook.create("player:first_load")
tag @s add first_load
say Loaded!
with Hook.at("load"):
scoreboard players reset @a obj.test
with Hook.at("player:first_load"):
tag @s abc.testing
say I am nice.