Persistent Data Value (Expression) — Skript
Addon: Skript · Category: Expression · Since: 2.15
Syntax
[the] [persistent] [%-*classinfo%] [list] data (value|tag) %string% of %chunks/worlds/entities/blocks/itemtypes/offlineplayers%Description
Provides access to the 'persistent data container' Bukkit provides on many objects. These values are stored on the chunk/world/item/entity directly, like custom NBT, but are much faster and reliable to access. Persistent values natively support numbers and text, but any Skript type that can be saved in a variable can also be stored in PDC via this expression. Lists of objects can also be saved. If you attempt to save invalid types, runtime errors will be thrown.
The names of tags must be valid namespaced keys, i.e. a-z, 0-9, '_', '.', '/', and '-' are the allowed characters. If no namespace is provided, it will default to 'minecraft'.
Examples
set persistent data tag "custom_damage" of player's tool to 10on jump:
if data tag "boost" of player's boots is set:
push player upwards
on shoot:
set {_strength} to number data tag "strength" of shooter's tool
if {_strength} is set:
set number data tag "damage" of projectile to {_strength}
on damage:
set {_damage} to data tag "damage" of projectile
if {_damage} is set:
set damage to {_damage}
set {_pet-uuids::*} to list data tag "pets" of player