# Events

```yaml
events:
    shift_right_click: #when you press shift+right click
        #....
    right_click: #when you right click
        #....
    shift_left_click: #when you shift+left click
        #....
    left_click: #when you left click
        #....
    attack: #when you attack a mob/player
        #...
    block_break: #when you break a block using this item or another one (depends)
                 #scroll down for more info
        #...
    fishing: #when you catch a fish with fishing rod
        #...
    kill_mob: #when you kill a mob
        #...
    wear: #when you wear an armor piece or hat
        #...
    unwear: #when you unwear an armor piece or hat
        #...
    held: #when set item in main hand to this custom item (hotbar)
        #...
    unheld: #when you change item in main hand
        #...
    drop: #when you drop this item
        #...
    pickup: #when you pickup this item
        #...
```

### Events: actions

Now that you know which events can be triggered you have to configure what happens&#x20;

```yaml
events:
    right_click:
        play_sound: knife
        play_particle: CRIT_MAGIC
        play_effect: SMOKE
        #you can create multiple rules for potion_effect
        #you just have to make the rule start with "potion_effect"
        potion_effect_1:
            type: HEAL
            duration: 200
            amplifier: 4
        potion_effect_2:
            type: UNLUCK
            duration: 200
            amplifier: 4
        #you can create multiple rules for remove_potion_effect
        #you just have to make the rule start with "remove_potion_effect"
        remove_potion_effect_1:
            type: GLOWING
        remove_potion_effect_2:
            type: HEAL
        execute_command:
            as_console: true
            #{player} will be automatically replaced with player name
            command: 'tellraw {player} {"text":"Pressed right mouse button","color":"gold"}'
        give_item: # give item to player
            item: empty_cup #material or custom item
        reduce_durability: 1
        reduce_amount: 1
        reduce_usages: 1
        replace_near_blocks:
            reduce_durability: 1
            radius:
              x: 2
              y: 2
              z: 2
            from: LAVA
            to: OBSIDIAN
        #you can create multiple rules for replace_near_blocks
        #you just have to make the rule start with "replace_near_blocks"
        replace_near_blocks_1:
            # ....
        replace_near_blocks_2:
            # ....
        replace_near_blocks_...:
            # ....
    block_break:
        drop_this_item: #when you break a block using any tool drops this custom item
            from_block: 
                FERN: #block broken
                    chance: 10       #chance of dropping this custom item
                    min_amount: 1    #min amount of this custo item to be dropped
                    max_amount: 2    #min amount of this custo item to be dropped
                    cancel_on_silktouch: true
                    need_pickaxe: false
                GRASS: #another block broken
                    chance: 10       #chance of dropping this custom item
                    min_amount: 1    #min amount of this custo item to be dropped
                    max_amount: 2    #min amount of this custo item to be dropped
                    cancel_on_silktouch: true
                    need_pickaxe: false
                #.... you can add more blocks if you need
                #..........
        drop_exp: #when you break a block holding this custom item item in hand
                    #drop exp
            chance: 50       #chance of dropping the exp
            min_amount: 1    #min exp amount
            max_amount: 3    #max exp amount
        multiple_break: #special property: breaks more than one block around the first
            keep_ores: true #are ores protected from the 3x3 break tool?
            drop_all_blocks: #if all blocks should be dropped on break or only the first
              enabled: true
              need_silk_touch: true #if you need silktouch to get all blocks
            size: 3 #size of the square to be mined
            depth: 1 #depth of the square to be mined
    fishing: #special event called when you fish
         drop_this_item: #drop the current item
            chance: 20 #chances of getting the tuna dropped
    kill_mob: #when you kill a witch it drops this item with 20% of chance
      drop_this_item:
        from_mob: 
            WITCH:
                chance: 20
    throw: #special event called when you throw a throwable item
        # ... refer to Throwables page, link on bottom of this page
    hit_ground: #special event called when a throwable item hits the ground
        # ... refer to Throwables page, link on bottom of this page
    
        
```

{% content-ref url="/pages/-Le8qRTQeYhFMV1ngFDu" %}
[Throwables](/itemsadder/specific-items/throwables.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lonedev.gitbook.io/itemsadder/items-properties/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
