-Door_Closer: - type: world - debug: false - events: - after player right clicks *door|*_gate priority:2: - - if !: - - stop - - wait 2s - - waituntil - - if : - - switch state:off - - choose : - - case door: - - playsound BLOCK_WOODEN_DOOR_CLOSE - - case trapdoor: - - playsound BLOCK_WOODEN_TRAPDOOR_CLOSE - - case gate: - - playsound BLOCK_FENCE_GATE_CLOSE - Decorator_Tool: type: item material: stick display name: Decorator Tool lore: - Right-click to mark location as decorative. - Left-click to unmark location. - Shift-right-click to toggle block state. Decorate_Command: type: command name: decorate usage: /decorate permission: beruscripts.decorator description: Gives the player a Decorator Tool. script: - if !: - give decorator_tool - narrate "You received a [Decorator Tool]." - narrate "Right-click to decorate, left-click to un-decorate." - narrate "Right-click while sneaking to toggle open/closed." - else: - take scriptname:decorator_tool - narrate "Removed your [Decorator Tool]." Decorative_Blocks: type: world debug: false misc_blocks: - loom - crafting_table - cartography_table - anvil - chipped_anvil - damaged_anvil - enchanting_table - grindstone - smithing_table - stonecutter - fletching_table events: on player right clicks block priority:1: - if ]>: - determine cancelled on player stands on material: - if ]>: - determine cancelled # Decorator tool functionality. on player clicks block with decorator_tool: - determine passively cancelled - if && == right_click_block: - switch - stop - choose : - case right_click_block: - if ! && ! && !]> && !: - narrate "You cannot make decorative." - stop - if ]>: - narrate "This is already decorative!" - stop - narrate "Made this decorative." - flag server decorative_block. - if && !: - narrate "(Also added adjacent block.)" - flag server decorative_block. - case left_click_block: - if !]>: - narrate "This is not decorative!" - stop - narrate "This is no longer decorative." - flag server decorative_block.:! - if && !: - narrate "(Also removed adjacent block.)" - flag server decorative_block.:! # Item protection. (Prevents decorator tool from being transfered to another inventory.) on player drops decorator_tool: - determine cancelled on player clicks in inventory with decorator_tool: - if != PLAYER: - determine cancelled on player clicks decorator_tool in inventory: - if && != PLAYER: - determine cancelled on player drags decorator_tool in inventory: - if != PLAYER: - determine cancelled # If any player breaks a decorative block, alerts them and removes decoration flag. on player breaks block priority:1: - if ]>: - narrate "You broke a decorative ." - flag server decorative_block.:! - if && !: - narrate "(Also removed adjacent block.)" - flag server decorative_block.:!