Paste #136738: Blacksmith script (attributes, enchantments, etc)

Date: 2025/10/20 08:26:54 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link





blacksmith_inventory:
    type: inventory
    inventory: chest
    title: Blacksmith Workshop
    size: 54
    gui: true
    slots:
    - [] [] [] [] [] [] [] [] []
    - [] [unbreakable_reforge] [] [block_break_speed_reforge] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []
    - [] [] [] [] [] [] [] [] []


unbreakable_reforge:
    type: item
    material: bedrock
    display name: Reforge Unbreakable
    lore:
    - Reforges unbreakable to a tool.
    - Costs 10 points.

block_break_speed_reforge:
    type: item
    material: stone
    display name: Reforge Block Break Speed
    lore:
    - Reforges Block Break Speed to a tool.
    - Costs 1 points.


blacksmith_world_script:
    type: world
    events:
        after player clicks unbreakable_reforge in blacksmith_inventory:
        - if <player.item_in_hand.material.name> == air:
            - narrate "That isn't an item! Please hold an item when you reforge."
            - stop

        - inventory adjust slot:hand unbreakable:true
        - inventory adjust slot:hand "lore:10 points"
        - narrate "Your tool has been reforged!"

        after player clicks block_break_speed_reforge in blacksmith_inventory:
        - definemap attributes:
            block_break_speed:
                key: blacksmith:add_bbs
                operation: ADD_NUMBER
                amount: 1
                slot: hand


        - if <player.item_in_hand.material.name> == air:
            - narrate "That isn't an item! Please hold an item when you reforge."
            - stop

        - inventory adjust slot:hand add_attribute_modifiers:<[attributes]>
        - narrate "Reforge was a success!"


blacksmith_npc_click_script:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        on click:
        - if !<player.has_flag[goblin_army]>:
            - narrate "You haven't defeated the goblin army!"
            - wait 2s
            - narrate "Come back when you have defeated them."
            - stop

        - inventory open d:blacksmith_inventory