Denizen Script Meta Documentation Search


Learn about how Denizen works in The Beginner's Guide.
Showing 35 search results for book out of 3884 meta-documentation entries...

Perfect Name Match Results



Mechanism


Namebook
ObjectItemTag
InputMapTag
Related Tags<ItemTag.is_book> Returns whether the item is considered an editable book. (...)
<ItemTag.book_title> Returns the title of the book.
<ItemTag.book_author> Returns the author of the book.
<ItemTag.book_pages> Returns the plain-text pages of the book as a ListTag.
DescriptionChanges the information on a book item.
Can have keys "pages" (a ListTag), "title", and "author", all optional.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L207

Partial Name Match Results



Event


Nameplayer edits book
Event Lines player edits book
player signs book
Triggerswhen a player edits or signs a book.
Generated Examplesafter player edits book:
after player signs book:
on player edits book:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.title> returns the name of the book, if any.
<context.pages> returns the number of pages in the book.
<context.book> returns the book item being edited, containing the new page contents.
<context.old_book> returns the book item being edited, containing the old page contents.
<context.signing> returns whether the book is about to be signed.
Determine"NOT_SIGNING" to prevent the book from being signed.
ScriptTag to set the book information to set it to instead.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerEditsBookScriptEvent.java#L23
Nameplayer uses recipe book
Event Lines player uses recipe book
Triggerswhen a player interacts with their recipe book.
Generated Exampleson player uses recipe book:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.recipe> returns the key of the recipe that was clicked.
<context.is_all> returns 'true' if the player is trying to make the maximum amount of items from the recipe, otherwise 'false'.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerClicksInRecipeBookScriptEvent.java#L14

Language


NameBook Script Containers
DescriptionBook script containers are similar to item script containers, except they are specifically
for the book items. They work with the ItemTag object, and can be fetched
with the Object Fetcher by using the ItemTag constructor book_script_name
Example: - give <player> my_book


Book_Script_Name:

    type: book

    # The 'custom name' can be anything you wish.
    # | All book scripts MUST have this key!
    title: custom name

    # The 'custom name' can be anything you wish.
    # | All book scripts MUST have this key!
    author: custom name

    # Defaults to true. Set to false to spawn a 'book and quill' instead of a 'written book'.
    # | Some book scripts might have this key!
    signed: true/false

    # Each -line in the text section represents an entire page.
    # To create a newline, use the tag <n>. To create a paragraph, use <p>.
    # | All book scripts MUST have this key!
    text:
    - page
    - ...
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java#L19

Mechanism


Namebook_author
ObjectItemTag
InputElementTag
Related Tags<ItemTag.book_author> Returns the author of the book.
DescriptionChanges the author of a book item.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L169
Namebook_generation
ObjectItemTag
InputListTag
Related Tags<ItemTag.book_generation> Returns the generation of the book (if any), as ORIGINAL, COPY_OF_ORIGINAL, COPY_OF_COPY, or TATTERED.
DescriptionSets the generation of the book (if any), as ORIGINAL, COPY_OF_ORIGINAL, COPY_OF_COPY, or TATTERED.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBookGeneration.java#L84
Namebook_pages
ObjectItemTag
InputListTag
Related Tags<ItemTag.book_pages> Returns the plain-text pages of the book as a ListTag.
DescriptionChanges the plain-text pages of a book item.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L150
Namebook_title
ObjectItemTag
InputElementTag
Related Tags<ItemTag.book_title> Returns the title of the book.
DescriptionChanges the title of a book item.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L188
Nameknowledge_book_recipes
ObjectItemTag
InputListTag
Related Tags<ItemTag.knowledge_book_recipes> Returns a recipes unlocked by this knowledge book. Recipes are in the Namespace:Key format, for example "minecraft:gold_nugget". (...)
DescriptionSets the item's knowledge book recipe list, in the Namespace:Key format.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemKnowledgeBookRecipes.java#L98
Nameopen_book
ObjectPlayerTag
InputNone
DescriptionForces the player to open the written book in their hand.
The book can safely be removed from the player's hand without the player closing the book.
Generated Example
- adjust <player> open_book
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L3703
Nameopen_offhand_book
ObjectPlayerTag
InputNone
DescriptionForces the player to open the written book in their offhand.
The book can safely be removed from the player's offhand without the player closing the book.
Generated Example
- adjust <player> open_offhand_book
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L3718
Nameshow_book
ObjectPlayerTag
InputItemTag
DescriptionDisplays a book to a player. Must be a WRITTEN_BOOK item.
For simple usage, consider specifying a book script name as the input.
Generated Example
- adjust <player> show_book:stick
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L3733

Tag


Name<EntityTag.bookshelf_slot>
ReturnsElementTag(Number)
DescriptionReturns the Chiseled Bookshelf slot that the entity is looking at, if any.
See also Tag:LocationTag.slot
Generated Example
- narrate "the number value is <player.bookshelf_slot>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java#L3238
Name<ItemTag.book_author>
ReturnsElementTag
MechanismItemTag.book_author
DescriptionReturns the author of the book.
Generated Example
- narrate <player.item_in_hand.book_author>
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L58
Name<ItemTag.book_generation>
ReturnsListTag
MechanismItemTag.book_generation
DescriptionReturns the generation of the book (if any), as ORIGINAL, COPY_OF_ORIGINAL, COPY_OF_COPY, or TATTERED.
Generated Example
- foreach <player.item_in_hand.book_generation> as:entry:
    - narrate "found <[entry]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBookGeneration.java#L48
Name<ItemTag.book_map>
ReturnsMapTag
MechanismItemTag.book
DescriptionReturns a MapTag of data about the book, with keys "pages" (a ListTag), and when available, "author" and "title".
Generated Example
- foreach <player.item_in_hand.book_map> key:key as:val:
    - narrate "<[key]> is set as <[val]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L101
Name<ItemTag.book_pages>
ReturnsListTag
MechanismItemTag.book_pages
DescriptionReturns the plain-text pages of the book as a ListTag.
Generated Example
- foreach <player.item_in_hand.book_pages> as:entry:
    - narrate "found <[entry]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L84
Name<ItemTag.book_title>
ReturnsElementTag
MechanismItemTag.book_title
DescriptionReturns the title of the book.
Generated Example
- narrate <player.item_in_hand.book_title>
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemBook.java#L71
Name<ItemTag.is_book>
ReturnsElementTag(Boolean)
DescriptionReturns whether the item is considered an editable book.
If this returns true, it will enable access to:
Mechanism:ItemTag.book,
Tag:ItemTag.book_author, Tag:ItemTag.book_title, and Tag:ItemTag.book_pages.
Generated Example
- if <player.item_in_hand.is_book>:
    - narrate "it was true!"
- else:
    - narrate "it was false!"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/ItemTag.java#L519
Name<ItemTag.knowledge_book_recipes>
ReturnsListTag
MechanismItemTag.knowledge_book_recipes
DescriptionReturns a recipes unlocked by this knowledge book. Recipes are in the Namespace:Key format, for example "minecraft:gold_nugget".
These keys are not necessarily 1:1 with material names, as seen in the example "minecraft:gold_ingot_from_nuggets".
Generated Example
- foreach <player.item_in_hand.knowledge_book_recipes> as:entry:
    - narrate "found <[entry]>"
Groupproperties
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/properties/item/ItemKnowledgeBookRecipes.java#L63

Semi-Strong Match Results



Event


Nameplayer discovers recipe
Event Lines player discovers recipe
Triggerswhen a player discovers a new item in the recipe book.
Generated Exampleson player discovers recipe:
after player discovers recipe:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.recipe_id> returns the ID of the recipe discovered.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerRecipeDiscoverScriptEvent.java#L14
Nameplayer takes item from lectern
Event Lines player takes item from lectern
player takes <item> from lectern
Triggerswhen a player takes a book from a lectern.
Generated Examplesafter player takes item from lectern:
on player takes waxed_weathered_chiseled_copper from lectern:
on player takes item from lectern:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag of the lectern.
<context.item> returns the book ItemTag taken out of the lectern.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerTakesFromLecternScriptEvent.java#L17

Semi-Decent Match Results



Command


NameTake
Syntaxtake [iteminhand/cursoritem/bydisplay:<name>/bycover:<title>|<author>/slot:<slot>/flagged:<flag>/item:<matcher>] (quantity:<#>) (from:<inventory>)
Short DescriptionTakes an item from the player.
Full DescriptionTakes items from a player or inventory.

If the player or inventory does not have the item being taken, nothing happens.

Using 'slot:' will take the items from that specific slot.

Using 'flagged:' with a flag name will take items with the specified flag name, see Language:flag system.

Using 'iteminhand' will take from the player's held item slot.

Using 'cursoritem' will take from the player's held cursor item (as in, one that's actively being picked up and moved in an inventory screen).

Using 'bydisplay:' will take items with the specified display name.

Using 'bycover:' will take a written book by the specified book title + author pair.

Using 'raw_exact:' (Intentionally undocumented) will compare all raw details of an item exactly. This is almost always a bad idea to use. DO NOT USE.

Using 'item:' will take items that match an advanced item matcher, using the system behind Language:Advanced Object Matching.

Flagged, Slot, ByDisplay, and Raw_Exact, all take a list as input to take multiple different item types at once.

If no quantity is specified, exactly 1 item will be taken.

Specifying a raw item without any matching method is considered unreliable and should be avoided.

Optionally using 'from:' to specify a specific inventory to take from. If not specified, the linked player's inventory will be used.

The options 'iteminhand' and 'cursoritem' require a linked player and will ignore the 'from:' inventory.

To take xp from a player, use Command:experience.
To take money from a player, use Command:money.
Related Tags<PlayerTag.item_in_hand> Returns the item the entity is holding, or air if none.
Usage Example
# Use to take an arrow from the player's enderchest
- take item:arrow from:<player.enderchest>
Usage Example
# Use to take the current holding item from the player's hand
- take iteminhand
Usage Example
# Use to take 5 emeralds from the player's inventory
- take item:emerald quantity:5
Groupitem
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/TakeCommand.java#L41

Event


Namemagicspells player learns spell
Event Lines magicspells player learns spell
Triggerswhen a player is about to learn a spell.
Generated Examplesafter magicspells player learns spell:
on magicspells player learns spell:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.spell_name> returns the name of the spell.
<context.source> returns the source. Can either be SPELLBOOK, TEACH, TOME or OTHER
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupDepenizen
RequiresDepenizen, MagicSpells
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/events/magicspells/SpellLearnScriptEvent.java#L15
Nameplayer flips lectern page
Event Lines player flips lectern page
Triggerswhen the player flips to a page in a lectern.
Example
# Announce the page the player flipped to.
on player flips lectern page:
- announce "<player.name> flipped to page #<context.new_page>!"
Example
# Flips the player to page 5 if they are flagged with "pancakes".
on player flips lectern page flagged:pancakes:
- determine page:5
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesbook:<item> to only process the event if the book on the lectern matches the given item.
Contexts<context.book> returns an ItemTag of the book in the lectern.
<context.lectern> returns a LocationTag of the lectern.
<context.old_page> returns an ElementTag(Number) of the last page the player was on.
<context.new_page> returns an ElementTag(Number) of the new page that the player flipped to.
<context.flip_direction> returns the direction in which the player flips the lectern book page, can be either LEFT or RIGHT.
Determine"PAGE:<ElementTag(Number)>" to set the page that the player will flip to.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerLecternPageChangeScriptEvent.java#L17
Nameplayer prepares item enchant
Event Lines player prepares item enchant
player prepares <item> enchant
Triggerswhen a player prepares to enchant an item.
Generated Exampleson player prepares item enchant:
on player prepares panda_spawn_egg enchant:
after player prepares item enchant:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.location> returns the LocationTag of the enchanting block.
<context.item> returns the ItemTag to be enchanted.
<context.bonus> returns an ElementTag(Number) of the enchanting bonus available (number of bookshelves).
<context.offers> returns a ListTag of the available enchanting offers, each as a MapTag with keys 'cost', 'enchantment_type', and 'level'.
Determine"OFFERS:<ListTag>" of MapTags to set the offers available. Cannot be a different size list than the size of context.offers.
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerPreparesEnchantScriptEvent.java#L20

Language


NameDenizen Text Formatting
DescriptionDenizen provides a variety of special chat format options like "on_hover" and "on_click".
These options exist within Denizen and do not appear in the historical Minecraft legacy chat format that most plugins and systems read.
That legacy system has 16 colors (0-9, A-F) and a few toggleable formats (bold, italic, etc). It does not contain anything that needs more than just an on/off.

Modern Minecraft, however, supports a JSON based "raw" message format that can do click events, hover events, full RGB colors, etc.

Denizen therefore has its own internal system that works like the legacy format system, but also supports the new options normally only available as 'raw JSON'.

Because it is entirely processed within Denizen, these options only work within Denizen, when performing actions that support raw JSON input.
This magic tool exists to let you write messages without having to write the messy JSON.

Be aware that many inputs do not support raw JSON, and as such are limited only the historical Minecraft legacy format.
Also be aware that click events, hover events, etc. are exclusively limited to the chat bar and the pages of books, as you cannot mouse over anything else.

Also note that RGB colors use a format that Spigot invented, meaning they will work in places that use Spigot's parser OR Denizen's version, but nowhere that uses the vanilla format still.

Thanks to Paper's implementation of component APIs where Spigot was too lazy to, Paper servers have advanced text formatting available in more areas.
GroupDenizen Magic
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/utilities/FormattedTextHelper.java#L22
NameEnchantment Script Containers
DescriptionEnchantment script containers allow you to register custom item enchantments.
For the most part, they work similarly to vanilla enchantments, albeit with some limitations.
These can be attached to enchanted books and used in anvils,
and can be generated by the enchanting table (requires discoverable: true and treasure_only: false).

In current implementation, custom enchantments do not appear in lore on their own, and will need fake lore added in their place.
This might be fixed in the future.

It may be beneficial in some cases to restart your server after making changes to enchantments, rather than just reloading scripts.
Rarity, Category, and Slots do not apply changes to an already-loaded script until the next restart (except when the script is newly added).

Using these may cause unpredictable compatibility issues with external plugins.

Enchantment scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).


Enchantment_Script_Name:

    type: enchantment

    # The ID is used as the internal registration key, and for lookups with things like the 'enchantments' mechanism.
    # If unspecified, will use the script name.
    # Limited to A-Z or _.
    # | Most enchantment scripts should have this key!
    id: my_id

    # A list of slots this enchantment is valid in.
    # | ALL enchantment scripts MUST have this key!
    slots:
    # Can be any of: mainhand, offhand, feet, legs, chest, head
    - mainhand

    # The rarity level of this enchantment. Can be any of: COMMON, UNCOMMON, RARE, VERY_RARE
    # If unspecified, will use COMMON.
    # | Most enchantment scripts should have this key!
    rarity: common

    # The category/type of this enchantment. Can be any of: ARMOR, ARMOR_FEET, ARMOR_LEGS, ARMOR_CHEST, ARMOR_HEAD,
    # WEAPON, DIGGER, FISHING_ROD, TRIDENT, BREAKABLE, BOW, WEARABLE, CROSSBOW, VANISHABLE
    # This is used internally by the enchanting table to determine which items to offer the enchantment for.
    # If unspecified, will use WEAPON.
    # | Most enchantment scripts should have this key!
    category: weapon

    # The per-level full name of this enchantment. Does not appear in lore automatically (but might in the future?).
    # Can make use of "<context.level>" for the applicable level.
    # | Most enchantment scripts should have this key!
    full_name: My Enchantment <context.level>

    # The minimum level of this enchantment.
    # If unspecified, will use 1.
    # | Most enchantment scripts can exclude this key.
    min_level: 1

    # The maximum level of this enchantment.
    # If unspecified, will use 1.
    # | Some enchantment scripts should have this key.
    max_level: 1

    # The per-level minimum XP cost of enchanting.
    # Can make use of "<context.level>" for the applicable level.
    # | Most enchantment scripts should have this key!
    min_cost: <context.level.mul[1]>

    # The per-level maximum XP cost of enchanting.
    # Can make use of "<context.level>" for the applicable level.
    # | Most enchantment scripts should have this key!
    max_cost: <context.level.mul[1]>

    # Whether this enchantment is only considered to be treasure. Treasure enchantments do not show in the enchanting table.
    # If unspecified, will be false.
    # | Most enchantment scripts can exclude this key.
    treasure_only: false

    # Whether this enchantment is only considered to be a curse. Curses are removed at grindstones, and spread from crafting table repairs.
    # If unspecified, will be false.
    # | Most enchantment scripts can exclude this key.
    is_curse: false

    # Whether this enchantment is only considered to be tradable. Villagers won't trade this enchantment if set to false.
    # If unspecified, will be true.
    # | Most enchantment scripts can exclude this key.
    is_tradable: true

    # Whether this enchantment is only considered to be discoverable.
    # If true, this will spawn from vanilla sources like the enchanting table. If false, it can only be given directly by script.
    # If unspecified, will be true.
    # | Most enchantment scripts can exclude this key.
    is_discoverable: true

    # A tag that returns a boolean indicating whether this enchantment is compatible with another.
    # Can make use of "<context.enchantment_key>" for the applicable enchantment's key, like "minecraft:sharpness".
    # This is used internally by the enchanting table and the anvil to determine if this enchantment can be given alongside another.
    # If unspecified, will default to always true.
    # | Most enchantment scripts can exclude this key.
    is_compatible: <context.enchantment_key.advanced_matches[minecraft:lure|minecraft:luck*]>

    # A tag that returns a boolean indicating whether this enchantment can enchant a specific item.
    # Can make use of "<context.item>" for the applicable ItemTag.
    # This is used internally to decide whether survival players can copy the enchantment between items on an anvil, as well as for commands like "/enchant".
    # If unspecified, will default to always true.
    # | Most enchantment scripts can exclude this key.
    can_enchant: <context.item.advanced_matches[*_sword|*_axe]>

    # A tag that returns a decimal number indicating how much extra damage this item should deal.
    # Can make use of "<context.level>" for the enchantment level,
    # and "<context.type>" for the type of monster being fought: ARTHROPOD, ILLAGER, WATER, UNDEAD, or UNDEFINED
    # If unspecified, will default to 0.0.
    # | Most enchantment scripts can exclude this key.
    damage_bonus: 0.0

    # A tag that returns an integer number indicating how much this item should protection against damage.
    # Can make use of "<context.level>" for the enchantment level, and "<context.cause>" for the applicable damage cause, using internal cause names (different from Spigot Damage Causes).
    # Internal cause names: inFire, lightningBolt, onFire, lava, hotFloor, inWall, cramming, drown, starve, cactus, fall, flyIntoWall,
    # outOfWorld, generic, magic, wither, anvil, fallingBlock, dragonBreath, dryout, sweetBerryBush, freeze, fallingStalactite, stalagmite
    # Also "<context.attacker>" as an EntityTag if the cause has an attacker specified.
    # If unspecified, will default to 0.
    # | Most enchantment scripts can exclude this key.
    damage_protection: 0

    # Triggered after an enchanted weapon is used to attack an entity.
    # Has <context.attacker> (EntityTag), <context.victim> (EntityTag), and <context.level>.
    # May fire rapidly or multiple times per hit. Use a ratelimit to prevent this.
    # | Some enchantment scripts should have this key.
    after attack:
    - narrate "You attacked <context.victim.name> with a <context.level> enchantment!"

    # Triggered after an enchanted armor is used to defend against an attack.
    # Also fires if an entity is holding a weapon with this enchantment while being hit.
    # Has <context.attacker> (EntityTag), <context.victim> (EntityTag), and <context.level>.
    # | Some enchantment scripts should have this key.
    after hurt:
    - narrate "You got hurt by <context.attacker.name> and protected by a level <context.level> enchantment!"
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EnchantmentScriptContainer.java#L33
NameItem Script Containers
DescriptionItem script containers are an easy way to pre-define custom items for use within scripts. Item
scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the
ItemTag constructor ItemTag_script_name. Example: - drop <player.location> super_dooper_diamond

The following is the format for the container. Except for the 'material' key (and the dScript
required 'type' key), all other keys are optional.


# The name of the item script is the same name that you can use to construct a new
# ItemTag based on this item script. For example, an item script named 'sword_of_swiftness'
# can be referred to as simply 'sword_of_swiftness'.
Item_Script_Name:

    type: item

    # Must be a valid ItemTag. See 'ItemTag' for more information.
    # | All item scripts MUST have this key!
    material: base_material

    # List any mechanisms you want to apply to the item within
    # | Some item scripts should have this key!
    mechanisms:
      # An example of a mechanism to apply
      unbreakable: true
      # Other common example
      custom_model_data: 5
      # This demonstrates how to add a custom attribute modifier.
      attribute_modifiers:
          # One subkey for each attribute you want to modify.
          # Valid attribute names are listed at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
          generic_armor:
              # Each attribute can have a list of modifiers, using numbered keys. They will be applied in numeric order, low to high.
              1:
                  # Each modifier requires keys 'operation' and 'amount', and can optionally have keys 'name', 'slot', and 'id'.
                  # Operations can be: ADD_NUMBER, ADD_SCALAR, and MULTIPLY_SCALAR_1
                  operation: add_number
                  amount: 5
                  # Slots can be: HAND, OFF_HAND, FEET, LEGS, CHEST, HEAD, ANY
                  slot: head
                  # ID is a UUID used to uniquely identify modifiers. If unspecified the ID will be randomly generated.
                  # Items with modifiers that lack IDs cannot be stacked due to the random generation.
                  id: 10000000-1000-1000-1000-100000000000

    # The 'custom name' can be anything you wish. Use color tags to make colored custom names.
    # | Some item scripts should have this key!
    display name: custom name

    # Lore lines can make items extra unique. This is a list, so multiple entries will result in multiple lores.
    # If using a replaceable tag, they are filled in when the item script is given/created/dropped/etc.
    # | Some item scripts should have this key!
    lore:
    - item
    - ...

    # If you want an item to be damaged on creation, you can change its durability.
    # | Most item scripts should exclude this key!
    durability: 12

    # Each line must specify a valid enchantment name.
    # | Some item scripts should have this key!
    enchantments:
    - enchantment_name:level
    - ...

    # Set this to 'true' to allow the item script item to be used in material-based recipe (eg most vanilla recipes).
    # Defaults to false if unspecified.
    # | Most item scripts should exclude this key!
    allow in material recipes: false

    # You can specify flags to be added to the item.
    flags:
      # Each line within the flags section should be a flag name as a key, and the flag value as the value.
      # You can use lists or maps here the way you would expect them to work.
      my_flag: my value

    # You can optionally add crafting recipes for your item script.
    # Note that recipes won't show in the recipe book when you add a new item script, until you either reconnect or use the "resend_recipes" mechanism.
    # | Most item scripts should exclude this key, unless you're specifically building craftable items.
    recipes:
        1:
            # The type can be: shaped, shapeless, stonecutting, furnace, blast, smoker, campfire, or smithing.
            # | All recipes must include this key!
            type: shaped
            # The recipe can optionally have a custom internal recipe ID (for recipe books).
            # If not specified, will be of the form "<type>_<script.name>_<id>" where ID is the recipe list index (starting at 1, counting up).
            # IDs will always have the namespace "denizen". So, for the below, the full ID is "denizen:my_custom_item_id"
            # Note that most users should not set a custom ID. If you choose to set a custom one, be careful to avoid duplicates or invalid text.
            # Note that the internal rules for Recipe IDs are very strict (limited to "a-z", "0-9", "/", ".", "_", or "-").
            # | Most recipes should exclude this key.
            recipe_id: my_custom_item_id
            # You can optionally add a group as well. If unspecified, the item will have no group.
            # Groups are used to merge together similar recipes in the recipe book (in particular, multiple recipes for one item).
            # | Most recipes should exclude this key.
            group: my_custom_group
            # You can optionally specify the quantity to output. The default is 1 (or whatever the item script's quantity is).
            # | Only some recipes should have this key.
            output_quantity: 4
            # You must specify the input for the recipe. The below is a sample of a 3x3 shaped recipe. Other recipe types have a different format.
            # You are allowed to have non-3x3 shapes (can be any value 1-3 x 1-3, so for example 1x3, 2x1, and 2x2 are fine).
            # For an empty slot, use "air".
            # By default, items require an exact match. For a material-based match, use the format "material:MaterialNameHere" like "material:stick".
            # To make multiple different items match for any slot, just separate them with slashes, like "stick/stone".
            # To match multiple materials, use "material:a/b/c".
            # You can also make a dynamic matcher using '*', like "material:*_log" to match any log block,
            # or 'test_*' to match any item script that has name starting with 'test_'.
            # Note that to require multiple of an item as an input, the only option is to use multiple slots.
            # A single slot cannot require a quantity of items, as that is not part of the minecraft recipe system.
            # | All recipes must include this key!
            input:
            - ItemTag|ItemTag|ItemTag
            - ItemTag|ItemTag|ItemTag
            - ItemTag|ItemTag|ItemTag
       # You can add as many as you want.
       2:
            # Sample of the format for a 2x2 recipe
            type: shaped
            input:
            - ItemTag|ItemTag
            - ItemTag|ItemTag
       3:
           # Shapeless recipes take a list of input items.
           type: shapeless
           # Optionally specify the shapeless category for shapeless recipes, as "building", "redstone", "equipment", or "misc". Defaults to "misc" if unspecified.
           # | Only some recipes should have this key.
           category: misc
           input: ItemTag|...
       4:
           # Stonecutting recipes take exactly one input item.
           type: stonecutting
           input: ItemTag
       5:
           # Furnace, blast, smoker, and campfire recipes take one input and have additional options.
           type: furnace
           # Optionally specify the cook time as a duration (default 2s).
           # | Only some recipes should have this key.
           cook_time: 1s
           # Optionally specify the cooking category for cooking recipes, as "food", "blocks", or "misc". Defaults to "misc" if unspecified.
           # | Only some recipes should have this key.
           category: misc
           # Optionally specify experience reward amount (default 0).
           # | Only some recipes should have this key.
           experience: 5
           input: ItemTag
       6:
           # Smithing recipes take one base item and one upgrade item.
           # In versions 1.20 and up, smithing recipes take one template item, one base item, and one upgrade item.
           type: smithing
           template: ItemTag
           base: ItemTag
           # Optionally, choose what values to retain, as a simple pipe-separated list of parts to retain.
           # If unspecified, no values will be retained.
           # Parts can be: 'display', 'enchantments'
           retain: display|enchantments
           upgrade: ItemTag

       7:
           # Brewing recipes take one base item and one ingredient item.
           # | Brewing recipes are only available on Paper versions 1.18 and up.
           # | Brewing recipes also have a special input option on 1.20 and above: "matcher:<item matcher>", to allow advanced matchers on the input/ingredient items.
           type: brewing
           input: ItemTag
           ingredient: ItemTag

    # Set to true to not store the scriptID on the item, treating it as an item dropped by any other plugin.
    # NOTE: THIS IS NOT RECOMMENDED UNLESS YOU HAVE A SPECIFIC REASON TO USE IT.
    # | Most item scripts should exclude this key!
    no_id: true/false

    # If your material is a 'written_book', you can specify a book script to automatically scribe your item
    # upon creation. See 'book script containers' for more information.
    # | Most item scripts should exclude this key, though there are certain rare cases it may be useful to.
    book: book_script_name
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java#L30

Mechanism


Namelast_interacted_slot
ObjectLocationTag
InputElementTag(Number)
Related Tags<LocationTag.last_interacted_slot> Returns the last interacted slot of a Chiseled Bookshelf inventory.
DescriptionSets the last interacted slot of a Chiseled Bookshelf inventory.
Generated Example
- adjust <player.location> last_interacted_slot:3
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4537
Namepage
ObjectLocationTag
InputElementTag(Number)
Related Tags<LocationTag.page> Returns the current page on display in the book on this Lectern block.
DescriptionSets the page currently displayed on the book in a lectern block.
Generated Example
- adjust <player.location> page:3
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4556

Tag


Name<LocationTag.last_interacted_slot>
ReturnsElementTag(Number)
MechanismLocationTag.last_interacted_slot
DescriptionReturns the last interacted slot of a Chiseled Bookshelf inventory.
Generated Example
- narrate "the number value is <player.location.last_interacted_slot>"
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4284
Name<LocationTag.page>
ReturnsElementTag(Number)
MechanismLocationTag.page
DescriptionReturns the current page on display in the book on this Lectern block.
Generated Example
- narrate "the number value is <player.location.page>"
Groupworld
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L3707
Name<LocationTag.slot[<vector>]>
ReturnsElementTag(Number)
DescriptionReturns the appropriate slot based on a given point along the bookshelves' surface relative to its position.
It will return 0 if the given vector is not within the bounds of any slot.
See also Tag:EntityTag.bookshelf_slot
Example
# Obtain and narrate the slot that the player right-clicked.
on player right clicks chiseled_bookshelf:
- define slot <player.eye_location.ray_trace.sub[<context.location>]>
- narrate <context.location.slot[<[slot]>]>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L4491
Name<p>
ReturnsElementTag
DescriptionReturns a paragraph, for use in books.
Generated Example
- narrate <p>
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/TextTagBase.java#L25