Radial Menu Entry

Data Type

An Object which defines an entry for the Radial Menu Entity Action.

Fields

Field Type Default Description
item Item Stack The item stack to display within the button for the entry.
entity_action Entity Action The entity action to be executed if the player clicks on this entry.
condition Entity Condition null The condition that must be true for this entry to appear in the list.
distance Integer -1 The distance, in pixels, this entry will travel from the center. If -1, it will use 1/4th of the screen's width.
velocity Integer -1 The speed, in pixels per tick, at which the entry will move from the center. If -1, it will travel however fast it needs to travel to be at the destination in 3 seconds. (To calculate a distance and velocity values for a specific time, use the formula time = distance / velocity. As an average rule of thumb, the distance when distance is -1 will be around 40.)

Examples

{
    "item": {
        "item": "minecraft:water_bucket",
        "tag": "{display:{Name:'{\"text\":\"Place Water\"}'}}"
    },
    "entity_action": {
        "type": "apoli:block_action_at",
        "block_action": {
            "type": "apoli:set_block",
            "block": "minecraft:water"
        }
    }
}

This example, if selected by the player, will place a water block at the player's location.

{
    "item": {
        "item": "minecraft:Lava_bucket",
        "tag": "{display:{Name:'{\"text\":\"Place Lava\"}'}}"
    },
    "entity_action": {
        "type": "apoli:block_action_at",
        "block_action": {
            "type": "apoli:set_block",
            "block": "minecraft:water"
        }
    },
    "condition": {
        "type": "apoli:dimension",
        "dimension": "minecraft:overworld",
        "inverted": true
    },
    "distance": 15,
    "velocity": 2
}

This example, if selected by the player, will place a lava block at the player's location. It will only appear in the menu if the player is not in the Overworld, and it will travel 15 pixels from the center at 2 pixels per tick.