Skip to content

Prevent Item Use

Power Type

Prevents the player from "using" (e.g: right-click action, such as eating, blocking, etc.) items.

Type ID: eggolib:prevent_item_use

Fields

Field Type Default Description
entity_action Entity Action Type optional If specified, this action will be executed on the player that has the power upon being prevented from using an item.
held_item_action Item Action Type optional If specified, this action will be executed on the item that was prevented from being used.
result_item_action Item Action Type optional If specified, this action will be executed on the item that is given upon being prevented from using an item.
item_condition Item Condition Type optional If specified, only items that fulfills this condition will be prevented from being used.
result_stack Item Stack optional If specified, this item will be given to the player upon being prevented from using an item.
hands Array of Strings ["main_hand", "off_hand"] Determines if the power should prevent the usage of items from the specified hand(s). Accepts "main_hand", "off_hand" or both.
priority Integer 0 Determines the execution priority of the power.

Examples

{
    "type": "eggolib:prevent_item_use",
    "hands": [
        "off_hand"
    ]
}

This example will prevent the player from using items in the offhand slot.

{
    "type": "eggolib:prevent_item_use",
    "item_condition": {
        "type": "apoli:ingredient",
        "ingredient": {
            "item": "minecraft:shield"
        }
    },
    "hands": [
        "main_hand"
    ]
}

This example will prevent the player from using Shields in the mainhand slot.