apartments_world: debug: false type: world events: ## session safety on player joins: - if : - run apartments_end_edit def.player: ## extra details on delta time secondly every:2: - actionbar "<&6>Editing apartment <&7>[]" targets: per_player ## invalid access on player right clicks block: - if : - stop - if == null: - stop - if !|]>: - determine cancelled ## ## complex creative safety cases ## # do not allow leaving actual apartment region on player walks: - if !: - stop - define apartment - if !]>: - determine cancelled # forbid trying to touch non-blocks in creative inventory on player clicks item in inventory: - if !: - stop - if != CREATIVE: - determine cancelled - if != CRAFTING: - determine cancelled - if && : - stop - determine cancelled passively - wait 1t - inventory update destination: - adjust item_on_cursor: # handle container drops & illegal block breaks on player breaks block bukkit_priority:monitor: - if : - stop # // careful: == null here; everywhere else it's != null - if ]> == null: - stop - if : - if == creative: - if > 0: - narrate "<&c>This container has items inside. You must clear it first before you can break it." - determine cancelled - ratelimit 1t - define contents - if <[contents].is_empty>: - stop - define half - if <[half]> == right: - define contents <[contents].get[1].to[27]> - else if <[half]> == left: - define contents <[contents].get[28].to[54]> - foreach <[contents]> as:item: - drop <[item]> delay:10t # forbid block update and physics inside apartments on block physics: - if != null: - stop - if ]> != null: - determine cancelled passively - foreach as:entity: - remove <[entity]> # forbid block update and physics for half blocks on player breaks block: # // careful: == null here; everywhere else it's != null - if ]> == null: - stop - define half - if <[half]> != null && !: - if == air: - if <[half]> != left && <[half]> != right: - modifyblock ]> air no_physics # forbid blocks that have NBT data - such as prefilled chests on player places block: # // careful: == null here; everywhere else it's != null - if ]> == null: - stop - if : - stop - if : - stop - if ].size.if_null[0]> > 0: - determine cancelled ## ## simple creative safety cases ## # forbid picking up and dropping items on player drops item: - if : - stop - if : - determine cancelled on player picks up item: - if : - stop - if : - determine cancelled # forbid water flow in apartment regions - if ]> != null: - determine cancelled # forbid sapling/other growing things in apartment regions on structure grows: - if ]> != null: - determine cancelled on plant grows: - if ]> != null: - determine cancelled # forbid any items dropping even if broken in apartment regions on block drops item from breaking: - if ]> != null: - determine cancelled # forbid any tnt in apartment regions on tnt primes: - if ]> != null: - determine cancelled # forbid gravity on blocks inside apartments on block falls: - if ]> != null: - determine cancelled # forbid shulker box usage inside apartments on player places *shulker_box: - if ]> != null: - if !: - determine cancelled # forbid mob spawner usage inside apartments on player places *spawner: - if : - stop - if ]> != null: - determine cancelled # prevent lectern grab on player takes item from lectern: - if : - stop - if !|]>: - determine cancelled # prevent redstone in apartments after redstone recalculated: - if ]> != null: - adjustblock power:0 no_physics # prevent piston use in apartments on piston extends: - if ]> != null: - determine cancelled