> For the complete documentation index, see [llms.txt](https://psyrioty.gitbook.io/magicairdrops-wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://psyrioty.gitbook.io/magicairdrops-wiki/interaction.md).

# Interaction

Interaction is responsible for clickability; it can be used to execute commands when right-clicking or to create a loot system. To use interaction, in the BDEngine editor, use the **interaction\_\<id>** tag for BlockDisplay. Example: **Tags:\["interaction\_0"]**. Repeat steps 3 and 4. Use the description and example airdrops.yml to create your interaction.

{% tabs %}
{% tab title="default" %}

```yaml
interactions:
  interaction_portal:
    #Commands that are executed on the right mouse button via interaction
    commands:
      - "execute in minecraft:the_nether run teleport {player_name} 220 128 197"
    #The message that appears when you right-click on an interaction if the event has not yet been activated.
    noActivateMessage: "#DDA0DDThe portal is locked. To open it, stay in this location for another: #B50778{activate_time}"
    #Maximum number of uses for all players. Set to -1 to allow unlimited uses.
    maxActivate: -1
    #The message that is displayed to the player if the interaction has already been used.
    activationErrorMessage: "#DDA0DDThis portal has already been used."
    #If the interaction should open a loot, then specify the loot ID
    lootName: ""
    #Maximum allowed use per player.
    #Set to -1 to allow the player to use interaction infinitely on right click.
    maxActivationForOnePlayer: 1
  interaction_chest:
    #Commands that are executed on the right mouse button via interaction
    commands:
      - "playsound minecraft:block.ender_chest.open ambient @a {x} {y} {z} 1 0.1"
    #The message that appears when you right-click on an interaction if the event has not yet been activated.
    noActivateMessage: "#DDA0DDIt's not safe to search the chest now. Remain in this area for another: #B50778{activate_time}"
    #Maximum number of uses for all players. Set to -1 to allow unlimited uses.
    maxActivate: -1
    #The message that is displayed to the player if the interaction has already been used.
    activationErrorMessage: "#DDA0DD"
    #If the interaction should open a loot, then specify the loot ID
    lootName: "dark_energy_chest"
    #Maximum allowed use per player.
    #Set to -1 to allow the player to use interaction infinitely on right click.
    maxActivationForOnePlayer: -1
  interaction_lectern:
    #Commands that are executed on the right mouse button via interaction
    commands:
      - "playsound minecraft:entity.villager.work_librarian ambient @a {x} {y} {z} 1 1"
      - "give {player_name} minecraft:globe_banner_pattern 1"
    #The message that appears when you right-click on an interaction if the event has not yet been activated.
    noActivateMessage: "#DDA0DDIt's not safe to do this. Remain in this area for another: #B50778{activate_time}"
    #Maximum number of uses for all players. Set to -1 to allow unlimited uses.
    maxActivate: 1
    #The message that is displayed to the player if the interaction has already been used.
    activationErrorMessage: "#DDA0DDThe item has already been taken."
    #If the interaction should open a loot, then specify the loot ID
    lootName: ""
    #Maximum allowed use per player.
    #Set to -1 to allow the player to use interaction infinitely on right click.
    maxActivationForOnePlayer: -1
```

{% endtab %}

{% tab title="MythicDungeons plugin" %}

```yaml
  interactions:
    interaction_portal:
      #Commands that are executed on the right mouse button via interaction
      commands:
        - "md play your_dungeon {player_name}"
      #The message that appears when you right-click on an interaction if the event has not yet been activated.
      noActivateMessage: "#DDA0DDThe portal is locked. To open it, stay in this location for another: #B50778{activate_time}"
      #Maximum number of uses for all players. Set to -1 to allow unlimited uses.
      maxActivate: -1
      #The message that is displayed to the player if the interaction has already been used.
      activationErrorMessage: "#DDA0DDThis portal has already been used."
      #If the interaction should open a loot, then specify the loot ID
      lootName: ""
      #Maximum allowed use per player.
      #Set to -1 to allow the player to use interaction infinitely on right click.
      maxActivationForOnePlayer: 1
      #For MythicDungeons only
      #Add an error message if you want there to be a check whether the player is the party leader
      #Uncomment if necessary.
      notLeaderPartyMessage: "#DDA0DDYou are not the party leader."
```

{% endtab %}
{% endtabs %}
