Date: 2015/04/07 20:13:44 UTC-07:00
Type: Denizen Script
dhunger_command_scan_chests:
type: task
debug: false
script:
- if <context.args.get[2].is[==].to[null]||true> && !<player.has_flag[dhg.edit]> {
- narrate "<&6>/dhg scan_chests <<>Arena ID<>>"
- narrate "<&6>Either select an arena or provide an arena name"
- queue clear
}
- if <context.args.get[2].is[==].to[null]||true> define arena <player.flag[dhg.edit]>
else define arena <context.args.get[2]>
- if %arena% != <def[arena].escaped> {
- narrate "<&6>That value doesn't look right."
- queue clear
}
- if <yaml[dhunger_saves].contains[dhg.arenas.%arena%]> && <server.list_notables[cuboids].contains[cu@dhg_%arena%]> {
- define chests 'li@'
- foreach <cu@dhg_%arena%.list_partial_chunks> {
- foreach <def[value].cuboid.get_blocks[chest,1|chest,2|chest,3|chest,4|chest,5|chest,6]> {
- if <def[value].is_within[dhg_%arena%]> {
- define chests '<def[chests].include[%value%]>'
}
}
}
}
else {
- narrate "<&6>Arena with that name not found."
}