Register Tag (Effect) — Skript

Addon: Skript · Category: Effect · Since: 2.10

Syntax

register [a[n]] [custom] (item|block|entity [type]) tag named %string% (containing|using) %entitydatas/itemtypes%

Description

Registers a new tag containing either items or entity datas. Note that items will NOT keep any information other than their type, so adding `diamond sword named "test"` to a tag is the same as adding `diamond sword` Item tags should be used for contexts where the item is not placed down, while block tags should be used for contexts where the item is placed. For example, and item tag could be "skript:edible", while a block tag would be "skript:needs_water_above". All custom tags will be given the namespace "skript", followed by the name you give it. The name must only include the characters A to Z, 0 to 9, and '/', '.', '_', and '-'. Otherwise, the tag will not register.

Please note that two tags can share a name if they are of different types. Registering a new tag of the same name and type will overwrite the existing tag. Tags will reset on server shutdown.

Examples

register a new custom entity tag named "fish" using cod, salmon, tropical fish, and pufferfish
register an item tag named "skript:wasp_weapons/swords" containing diamond sword and netherite sword
register block tag named "pokey" containing sweet berry bush and bamboo sapling
on player move:
	block at player is tagged as tag "skript:pokey"
	damage the player by 1 heart

View source