fort_pic: type: item material: stone_pickaxe display name: Pickaxe fort_pic_handler: type: world debug: false events: on player animates ARM_SWING with:fort_pic flagged:fort.pic.block_target: - define block - flag player fort.pic.block_target:<[block]> duration:3t #- if <[block].flag[health]> == -1: #- determine passively cancelled - blockcrack <[block]> progress:0 players: - ratelimit 1t on player clicks block type:!air: - stop if: - determine passively cancelled - if == fort_pic: - define block - flag player fort.pic.block_target:<[block]> duration:1t #flag the block health if it hasn't been set yet - if !<[block].has_flag[health]>: - define mat <[block].material.name> - define type ]> #if it's not in the list of valid materials to return either wood, brick, or metal - if <[type]> == null: - define hp -1 - else: - define hp .hp]> - flag <[block]> health:<[hp]> #infinite durability on fort_pic takes damage: - determine cancelled on player drops fort_pic: - determine cancelled on player clicks fort_pic in inventory: - determine cancelled #based on the material inputted, it returns either wood, brick, or metal get_material_type: type: procedure debug: false definitions: actual_material script: - foreach as:type: - if .valid_materials].contains[<[actual_material]>]>: - define material_type <[type]> - foreach stop - define material_type null if:!<[material_type].exists> - determine <[material_type]>