wardinglantern: type: item debug: true material: PAPER display name: <&color[#FFDFD3]>Warding Beacon lore: - <&[lore]><&color[#CF9FFF]> - <&[lore]> - <&[lore]><&color[#6bb0e8]> Ward off unwanted guests - <&[lore]> - <&[lore]><&color[#c9f0f2]> Prevents hostile mobs spawning - <&[lore]><&color[#c9f0f2]> within 15 blocks in all directions - <&[lore]> - <&[lore]> ➡ Place to activate - <&[lore]> - <&[lore]><&color[#CF9FFF]><&color[WHITE]><&color[#CF9FFF]> mechanisms: custom_model_data: 10677 hides: ALL flags: lantern: true wardinglanterndummy: type: item debug: true material: PAPER display name: mechanisms: custom_model_data: 10677 hides: ALL lantern_of_warding: type: world debug: true events: on player right clicks block with:item_flagged:lantern type:!air: - if == && !: - determine passively cancelled - spawn item_frame[rotation=up;framed=wardinglanterndummy;visible=false] - flag lantern_of_warding - actionbar "<&a>Warding Beacon Placed - Area Safe" - take item:wardinglantern - define loc - define cuboid ,<[loc].x.add[15]>,<[loc].y.add[15]>,<[loc].z.add[15]>,<[loc].x.add[-15]>,<[loc].y.add[-15]>,<[loc].z.add[-15]>]> - flag cuboid:<[cuboid]> - if !].exists>: - note <[cuboid]> as:lantern_of_warding_ - else: - note ].add_member[<[cuboid]>]> as:lantern_of_warding_ on item_frame damaged by player: - if : - actionbar "<&c>Warding Beacon Broken - Area unsafe" - spawn dropped_item[item=wardinglantern] - flag lantern_of_warding:! - if ].members_size> == 1: - note remove as:lantern_of_warding_ - else: - foreach ].list_members> as:entry: - if <[entry]> == : - adjust ]> remove_member:<[loop_index]> - foreach stop - remove - determine cancelled on hanging breaks: - if : - determine cancelled on entity spawns in:lantern_of_warding_*: - if !: - stop - playeffect effect:END_ROD at: quantity:5 data:0.1 - determine cancelled