Nexo
  • ๐Ÿ Home
  • ๐Ÿ“œMain Changelog
  • โ“FAQ
  • General Usage
    • โŒจ๏ธCommands
    • ๐Ÿง‘โ€๐ŸณRecipes
  • Migrate
    • โ˜„๏ธOraxen โ†’ Nexo
    • ๐Ÿ“ฆItemsAdder โ†’ Nexo
  • Configuration
    • โš™๏ธPlugin settings
    • ResourcePack
    • โš’๏ธItems
      • Special Item Appearance
    • โ›‘๏ธCustom Armors
      • ๐ŸชฝCustom Elytras (1.21.2+)
      • Component Based (1.21.2+)
      • Trims Based (1.20-1.21.1)
    • ๐ŸŒ€Glyphs
    • ๐ŸŽตSounds
  • Mechanics
    • ๐Ÿช‘Furniture Mechanic
      • ๐ŸŽฏHitbox
      • ๐Ÿ–‡๏ธConnectable Furniture
      • ๐Ÿช‘Seat Mechanic
      • ๐Ÿ›๏ธBed Mechanic
      • ๐Ÿ’กLight Mechanic
      • ๐Ÿง‘โ€๐ŸŒพFarming Mechanic
    • ๐Ÿ“ฆCustom Block Mechanics
      • ChorusBlock Mechanic
      • ๐ŸŽถNoteBlock Mechanic
        • Stripped Log Mechanic
        • Directional Mechanic
      • ๐ŸงตStringBlock Mechanic
    • ๐Ÿ”ฑCustom Trident
    • Other Mechanics
    • clickAction Mechanic
    • Custom Mechanic
  • โž•Addons
    • ๐ŸšชCarpentry
    • ๐ŸงฉCore Shaders
      • Text Effects by Akis
  • Compatibility
    • ModelEngine - custom mobs
    • MythicMobs - custom mobs
    • MythicCrucible
    • MMoItems
    • EcoItems
  • Community Guides
    • Vendors
    • API
Powered by GitBook
On this page
  • How does it work?
  • A comprehensive example
  • Available events
  • CLICK:mouse_click_type:target_type
  • DROP
  • PICKUP
  • BREAK
  • EQUIP
  • UNEQUIP
  • INV_CLICK
  • DEATH
  • Available conditions
  • HAS_PERMISSION:the.permission
  • Available actions
  • COMMAND:sender:command
  • MESSAGE:content
  • ACTIONBAR:content
  1. Mechanics

Custom Mechanic

This mechanism allows you to realize an extremely customizable mechanism without programming

PreviousclickAction MechanicNextCarpentry

Last updated 4 months ago

How does it work?

This mechanic is for items only and does not work with blocks/furniture. For that check the . The mechanics let you create subsections composed of 3 parts:\

  • Event: when is this mechanic triggered? e.g. when you right-click on a block

  • Conditions: a set of conditions that must be satisfied. e.g. having a permission

  • Actions: a set of actions to perform. e.g. send a command or a message

An optional settings called oneUsage allows you to imitate the use of an item at 1.

A comprehensive example

myitem:
  Mechanics:
    custom:
      test:
        one_usage: false
        event: "CLICK:right:all"
        conditions:
          - '#player.hasPermission("example.permission")'
        actions:
          - "[console] give <player> cooked_beef 1"

In this example, the subsection test defines a custom mechanic triggered when someone right click (on a block or in the air). If this player has the permission example.permission, the console will perform the give command and replace <player> by the player name. The item won't be consumed (oneUsage: false).

Available events

CLICK:mouse_click_type:target_type

Called when you click with the item.

mouse_click_type: [ right, left, all ] target_type: [ block, air, all ]

DROP

Called when you drop the item.

PICKUP

Called when you pick up the item.

BREAK

Called when a player breaks an item.

EQUIP

Called when a player equips an item.

UNEQUIP

Called when a player unequips an item.

INV_CLICK

Called when a player clicks an item in an inventory.

DEATH

Called when a player dies and would normally drop the given item.

Available conditions

HAS_PERMISSION:the.permission

the.permission: The permission required by the player using the item

Available actions

COMMAND:sender:command

sender: [ console, player ] command: The command to perform. The placeholder <player> can be used.

MESSAGE:content

content: Content of the message to send (it supports minimessage format)

ACTIONBAR:content

content: Content of the message to send (it supports minimessage format)

clickAction mechanic
Page cover image