Oraxen
Search…
Custom mechanic
This mechanism allows you to realize an extremely customizable mechanism without programming

How does it work?

The mechanics let you create sub-sections 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

1
Mechanics:
2
custom:
3
test:
4
oneUsage: false
5
event: "CLICK:right:all"
6
conditions:
7
- "HAS_PERMISSION:example.permission"
8
actions:
9
- "COMMAND:console:give <player> cooked_beef 1"
Copied!
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.

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)
Last modified 2mo ago