ItemComponent - Death Protection Component Apply (Section) — SkBee
Addon: SkBee · Category: Section · Since: 3.8.0
Syntax
apply death protection [component] to %itemstacks/itemtypes/slots%Description
Apply a death protection component to an item. If present, this item protects the holder from dying by restoring a single health point. Requires Paper 1.21.3+ See [**Death Protection Component**](https://minecraft.wiki/w/Data_component_format#death_protection) on McWiki for more info. `death_effect` = A `consume effect` to by applied to the component (supports a list) [Optional]. `death_effects` = A section to apply `consume effects` [Optional].
Examples
set {_p::1} to potion effect of night vision for 10 seconds
set {_p::2} to potion effect of slow mining for 5 seconds
set {_effects} to apply_effects({_p::*}, 0.5)
set {_i} to 1 of stick
apply death protection component to {_i}:
death_effects: {_effects}
give {_i} to player
apply death protection to {_i}:
death_effects:
apply -> potion effect of slowness for 10 seconds with probability 0.5
apply -> clear all effects
apply -> remove effects night vision
apply -> play sound "blah.blah"
apply -> teleport randomly within 15
apply -> teleport randomly within 20 meters
apply -> teleport randomly within 100 blocks