Paste #69494: Untitled Paste

Date: 2020/05/24 07:18:39 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


maple_planks:
    type: item
    display name: "<&7><&l>Maple Planks"
    material: acacia_planks
convert_wood:
    type: world
    events:
        after player picks up acacia_log:
        - define original_block <player.inventory.find[acacia_log]>
        - inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Log"
        after player picks up stripped_acacia_wood:
        - define original_block <player.inventory.find[stripped_acacia_wood]>
        - inventory adjust slot:<[original_block]> "display_name:<&7><&l>Stripped Maple Wood"
        after player picks up stripped_acacia_log:
        - define original_block <player.inventory.find[stripped_acacia_log]>
        - inventory adjust slot:<[original_block]> "display_name:<&7><&l>Stripped Maple Log"
        after player picks up acacia_wood:
        - define original_block <player.inventory.find[acacia_wood]>
        - inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Wood"
        after player picks up acacia_planks:
        - define original_block <player.inventory.find[acacia_planks]>
        - inventory adjust slot:<[original_block]> "display_name:<&7><&l>Maple Planks"
        on acacia_planks recipe formed:
        - determine <item[maple_planks]>
        on player crafts acacia_planks:
        - determine <item[maple_planks]>
convert_saplings:
    type: world
    events:
        after player picks up acacia_sapling:
        - define original_sapling <player.inventory.find[acacia_sapling]>
        - inventory adjust slot:<[original_sapling]> "display_name:<&7><&l>Maple Sapling"

tree_listener:
    type: world
    events:
        on structure grows:
        - if <context.location.biome.name> == plains:
            - modifyblock <context.location> air
            - determine passively cancelled
            - choose <util.random.int[1].to[6]>:
                - case 1:
                    - ~schematic load name:maplesmall1
                    - schematic paste name:maplesmall1 <context.location> noair
                - case 2:
                    - ~schematic load name:maplesmall2
                    - schematic paste name:maplesmall2 <context.location> noair
                - case 3:
                    - ~schematic load name:maplesmall3
                    - schematic paste name:maplesmall3 <context.location> noair
                - case 4:
                    - ~schematic load name:maplesmall4
                    - schematic paste name:maplesmall4 <context.location> noair
                - case 5:
                    - ~schematic load name:maplesmall5
                    - schematic paste name:maplesmall5 <context.location> noair
woodcutting_listener:
    type: world
    events:
        on player places acacia_log:
        - flag server woodcutting.player_made_trees.<context.location.simple>
        - announce flagged
        on player left clicks block with item:
        - if <server.has_flag[woodcutting.player_made_trees.<context.location.simple>]>:
            - determine cancelled
        - if !<context.item.has_script>:
            - determine cancelled
        #choose axe type
        - choose <context.script.name>:
            - case bronze_axe:
                - define axe <item[bronze_axe]>
            - default:
                - determine cancelled

        #choose log

        - if !<player.has_flag[woodcutting.tree]>:
            - choose <context.location.material>:
                - case acacia_log:
                    - flag player woodcutting.tree.<context.location.simple>
                    - flag player woodcutting.chop_count:0
                    - spawn hologram <context.location> save:woodcutting_display
                    - equip <entry[woodcutting_display].spawned_entity>
                    - adjust <entry[woodcutting_display].spawned_entity> custom_name_visible:true
                    - adjust <entry[woodcutting_display].spawned_entity> custom_name:<&4>0%
                    - flag player woodcutting.entity:<entry[woodcutting_display].spawned_entity>

        #run the script

        - if <player.has_flag[woodcutting.cooldown]>:
            - narrate "<&c>You swing your axe and miss."
            - playsound entity_llama_spit <player.location> pitch:-2
            - determine cancelled

        - choose <[axe].script.name>:
            - case bronze_axe:
                - flag player woodcutting.cooldown duration:5s
                - flag player woodcutting.chop_count:++
                - flag player woodcuttingxp:+:.30
                - actionbar "<&a><&l>+ .30 XP"
                - playsound block_wood_break <player.location> pitch:3
                        - choose <player.flag[woodcutting.chop_count]>:
                            - case 1:
                                - adjust <player.flag[woodcutting.entity]> custom_name:<&c><&l>20%
                            - case 2:
                                - adjust <player.flag[woodcutting.entity]> custom_name:<&6><&l>40%
                            - case 3:
                                - adjust <player.flag[woodcutting.entity]> custom_name:<&e><&l>60%
                            - case 4:
                                - adjust <player.flag[woodcutting.entity]> custom_name:<&2><&l>80%
                            - case 5:
                                - adjust <player.flag[woodcutting.entity]> custom_name:<&a><&l>100%
                                - playsound block_anvil_use <player.location> pitch:3
                                - flag player woodcutting.tree.<context.location.simple>:!
                                - remove <player.flag[woodcutting.entity]>
                                - flag player woodcutting.entity:!
                                - flag player woodcutting.chop_count:!