CreateLock:
type: world
events:
on player clicks wood_door with tripwire_hook:
- if <context.item.has_lore> {
- narrate "This key cannot be crafted into another lock."
- - determine CANCELLED
- queue clear
}
- - if <context.location.block.below.is[==].to[i@wood_door]> {
+ - if <context.location.block.below.is[==].to[m@wood_door]> {
- if <context.location.block.below.is[==].to[<global.flag[locked_Doors]>]> {
- narrate "This door is already locked."
- queue clear
}
} else if <context.location.block.is[==].to[<global.flag[locked_Doors]>]> {
- narrate "This door is already locked."
- queue clear
}
- define w <context.location.world.name>
- define y <context.location.block.y.as_int>
- define x <context.location.block.x.as_int>
- define z <context.location.block.z.as_int>
- flag global locked_Doors.incrementer:++
- flag global locked_Doors.<def[w]>.<def[y]>.<def[x]>.<def[z]>:<global.flag[locked_doors.incrementer]>
- take iteminhand
- drop <player.location> tripwire_hook[lore=<global.flag[locked_Doors.incrementer]>]
-