schematic_data: type: yaml data triggers: # Material names to check on block place # Each schematic entry for that material will be checked each time the trigger block is placed #- 'SCHEMATIC_NAME/IGNORE_AIR(Boolean)(/Creation Script(/Deletion Script))' dirt: - 'example_schematic/false' diamond_block: # Checks against schematic 'altar_example' and requires air blocks to match the schematic - 'altar_example/false/altar_created/altar_deleted' altar_created: type: task speed: 0 script: - narrate "Created!" alter_deleted: type: task speed: 0 script: - narrate "Deleted!" # Handles creation and removal of notable cuboids when a player places a schematic listed in 'schematic_data'. # Will save schematics in form "schematic__" # For example, "schematic_1,2,3,world_examplename" schematic_check_evt: type: world events: # Checks for a trigger block, then checks for a matching schamatic, and notes if found on player places block: - if ]> { - foreach ]> { - if !].exists> { - queue clear } - run schematic_checker def:|| - if { - note ].cuboid[]> as:schematic__ } - flag server schem_check:! - if >= 3 { - run } - if == 4 { - flag server schem_deletion_scripts.schematic__: } } } on player breaks block in notable cuboid: - foreach { - note remove as: - if ]> { - run ]> - flag server schem_deletion_scripts.:! } } # Checks if a schematic matches the placed blocks around a location # USAGE SAMPLE: # - run schematic_checker def:|| # - if { ... } # - flag server schem_check:! schematic_checker: type: procedure debug: true definitions: location|schematic|ignore_air speed: 0 script: - define cuboid ].cuboid[]> - define adjusted_location ].origin>]> - inject locally ]:ignore_air||with_air> - flag server schem_check:true with_air: - foreach : - define schem_mat ].block[]>].name> - if != air && != { - flag server schem_check:false } ignore_air: - foreach : - define schem_mat ].block[]>].name> - if != { - flag server schem_check:false }