Skip to content

More Attributes

Snownee edited this page Oct 20, 2021 · 5 revisions

More Attributes

food

  • value: Object

Makes item edible.

Example:

{
"food": {
  "nutrition": 2, // mandatory
  "saturation": 0.5, // mandatory
  "fast": false,
  "alwaysEat": false,
  "meat": false,
  "animation": "eat", // or "drink", "none"
  "effect": [
    {
      "probability": 1,
      "effect": "speed",
      "duration": 100, // in tick
      "amplifier": 0,
      "ambient": false,
      "visible": true
    },
    {
      "probability": 0.5,
      "effect": "poison",
      "duration": 100, // in tick
    }
  ]
}
}

event.useOnBlock

  • value: Action string or object or a list of them.

Performs actions when a player right-clicks on the block.

Example:

{
"event.useOnBlock": {
  "action": [
    {
      "type": "sit"
    }
  ]
}
}
{
"event.useOnBlock": {
  "action": [ "sit" ]
}
}
{
"event.useOnBlock": {
  "action": "sit"
}
}

event.attackBlock

  • value: Action object or objects

Performs actions when a player left-clicks on the block.

event.projectileHit

  • value: Action object or objects

Performs actions when a projectile hits on the block.