This update completely changes how you write functions and actions, it also adds some new actions like: 'return|stop' and 'cancel-event'.
How to update:
- Backup your generators and everything you want to save.
- Delete generators in folder and regenerate examples.
- Update your old generator functions to use the new system, and put them back in the folder.
I am sorry for the inconvenience, this should be the last time when an update breaks older versions so severely.
Example:
Code (YAML):
# BEFORE
on-break:
- if
:
-
[ has permission, orestack.generator.harvest
]
do
:
-
[ give item, emerald
]
-
[ spawn particle at block, fire_ring
]
-
[ chat message,
"You mined emerald!"
]
or
:
-
[ cancel-event
]
# This action was only added in 3.21.0
-
[ chat message,
"&4You don't have permission to mine this block!"
]
# AFTER
on-break:
- if
: hasPermission orestack.generator.harvest
do
:
- giveItem emerald
- spawnParticleAtBlock fire_ring
- chatMessage <You mined emerald!>
or
:
- cancelEvent
- chatMessage <&4You don't have permission to mine this block!
>
# AFTER, Another Example
on-break:
do
:
# These examples are for actions, but it is exactly the same with conditions
- <chat message> <&aHere have an emerald!>
# if there is spaces you need to enclose it in <> brackets
- chat_message
NO!
# No spaces in the message so no need for brackets
- chatMessage <Hello Everyone!>
# This is the preferred format but others are also viable