Skip to content

Entity Modifiers

ErrorCraft edited this page Jun 12, 2022 · 6 revisions

Entity modifiers are JSON files in data packs placed under the modifiers/entities folder in your namespace. These modifiers can be applied using the entity command.

minecraft:set_absorption

Sets the absorption of a living entity.

Properties

absorption: A number provider. Specifies the absorption to set.
add: An optional boolean. If true, change will be relative to the current absorption.

Example

{
    "function": "minecraft:set_absorption",
    "absorption": 5.0,
    "add": true
}

minecraft:set_air_time

Sets the air time of an entity.

Properties

time: A number provider. Specifies the air time to set.
add: An optional boolean. If true, change will be relative to the current air time.

Example

{
    "function": "minecraft:set_air_time",
    "time": 5,
    "add": true
}

minecraft:set_custom_name

Sets the custom name of an entity.

Properties

name: A text component. Advanced components are resolved using the entity that is being modified.
visible: An optional boolean. Specifies if the name should be visible or not.

Example

{
    "function": "minecraft:set_custom_name",
    "name": {
        "text": "Hello There!",
        "color": "blue"
    },
    "visible": true
}

minecraft:set_fire_time

Sets the fire time of an entity.

Properties

time: A number provider. Specifies the fire time to set.
add: An optional boolean. If true, change will be relative to the current fire time.

Example

{
    "function": "minecraft:set_fire_time",
    "time": 5,
    "add": true
}

minecraft:set_health

Sets the health of a living entity.

Properties

health: A number provider. Specifies the health to set.
add: An optional boolean. If true, change will be relative to the current health.

Example

{
    "function": "minecraft:set_health",
    "health": 5.0,
    "add": true
}

minecraft:set_hunger

Sets the hunger of a player.

Properties

hunger: A number provider. Specifies the hunger to set.
add: An optional boolean. If true, change will be relative to the current hunger.

Example

{
    "function": "minecraft:set_hunger",
    "hunger": 5,
    "add": true
}

minecraft:set_invulnerable

Sets the invulnerability of an entity.

Properties

invulnerable: A boolean. If true, the entity won't take any damage.

Example

{
    "function": "minecraft:set_invulnerable",
    "invulnerable": true
}

minecraft:set_position

Sets the position of an entity.

Properties

potition: A position provider. Specifies the position to set.

Example

{
    "function": "minecraft:set_position",
    "position": {
        "type": "minecraft:world",
        "x": 10.0,
        "y": 64.0,
        "z": 150.0
    }
}

minecraft:set_rotation

Sets the rotation of an entity.

Properties

rotation: A rotation provider. Specifies the rotation to set.

Example

{
    "function": "minecraft:set_rotation",
    "rotation": {
        "x": 10.0,
        "y": 45.0
    }
}

minecraft:set_saturation

Sets the saturation of a player.

Properties

saturation: A number provider. Specifies the saturation to set.
add: An optional boolean. If true, change will be relative to the current saturation.

Example

{
    "function": "minecraft:set_saturation",
    "saturation": 5.0,
    "add": true
}