Skip to main content

Modify Bounciness (Power Type)

Makes the entity bounce off blocks it lands on. The speed it hits the ground with goes through the attribute modifiers and becomes upward speed. A result of 0.125 or less is too small to bounce and is ignored.

Type ID: apoli:modify_bounciness

Fields

FieldTypeDefaultDescription
block_conditionBlock Condition TypeoptionalOnly bounce off blocks that pass this condition. Without it, every block bounces.
modifierAttribute ModifieroptionalApplied to the landing speed to get the bounce height.
modifiersArray of Attribute ModifieroptionalSeveral modifiers.
block_actionBlock Action TypeoptionalRuns on the block landed on each time the entity bounces.
entity_actionEntity Action TypeoptionalRuns on the bouncing entity each time it bounces.
damageBooleanfalseWhether the entity still takes fall damage on a matching block. With false, a matching landing doesn't hurt, as on a slime block.
preventableBooleantrueWhether sneaking cancels the bounce, as it does on a slime block. Set it to false and the entity bounces even while sneaking.

damage and preventable are read from every matching power. If any of them sets damage: true the landing hurts, and if any sets preventable: true sneaking cancels the bounce. Neither field does anything unless a power matches the block being landed on, so an entity without apoli:modify_bounciness takes fall damage as it does in vanilla.

Examples

Bounce off everything at half the speed you hit the ground with:

{
  "type": "apoli:modify_bounciness",
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": 0.5
  }
}

Bounce only off wool, keep taking fall damage, and ignore sneaking:

{
  "type": "apoli:modify_bounciness",
  "block_condition": {
    "type": "apoli:in_tag",
    "tag": "minecraft:wool"
  },
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": 0.8
  },
  "damage": true,
  "preventable": false
}

Bounce and play a sound each time:

{
  "type": "apoli:modify_bounciness",
  "modifier": {
    "operation": "multiply_base_multiplicative",
    "value": 0.9
  },
  "entity_action": {
    "type": "apoli:play_sound",
    "sound": "minecraft:entity.slime.squish",
    "volume": 0.6
  }
}