Name | Assignment Script Containers |
Description | Assignment script-containers provide functionality to NPCs by 'assignment' of the container. Assignment
scripts are meant to be used when customizing the normal behavior of NPCs. This can be used on a 'per-NPC' basis, but the encouraged approach is to design assignment scripts in a way that they can be used for multiple NPCs, perhaps with the use of constants or flags to determine specific information required by the scripts. Features unique to assignment script-containers include 'actions' and 'interact script' assignment. Like any script, the ability to run local utility scripts can be accomplished as well. This allows fully interactive NPCs to be built purely with Assignment Scripts, and for advanced situations, world scripts and interact scripts can provide more functionality. See also interact script containers Assignments scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags). This will disable any "actions" on the script (but not interact scripts steps - disable the interact for that). Basic structure of an assignment script:
Though note that almost always you should include the 'actions:' key, usually with the 'on assignment:' action (if using triggers). Refer to assignment. |
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/AssignmentScriptContainer.java#L13 |
Name | Book Script Containers |
Description | Book script containers are similar to item script containers, except they are specifically
for the book items. They work with 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
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/BookScriptContainer.java#L19 |
Name | Command Script Containers |
Description | Command script containers allow you to register your own custom commands to the server.
This also allows the command to show up in the '/help' command, with some info on the command. Note that existing names or aliases from other plugins will be overridden. If you want to run a script at the same time as an existing command, see on command. The following is the format for the container. The required keys are 'name:', 'description:', 'usage:', and 'script:' All other keys can be excluded if unneeded. If you are not intentionally setting a specific value for the other keys, it is strongly recommended that you simply not include them at all. Please note that 'name:' is the true name of the command (written by users), and 'usage:' is for documentation in the '/help' command. These two options should almost always show the same name. Command scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java#L28 |
Name | Custom Script Containers |
Description | Custom script containers are used to define a template type for a custom object.
Usage of these should generally be avoided, as they can be considered 'over-engineering'... That is, using a very complicated solution to solve a problem that can be solved much more simply. Custom objects exist for experimental reasons. Use at your own risk. Custom script containers have no required keys but several optional ones. Use 'tags' key to define scripted tags, 'mechanisms' to define scripted mechanisms, 'inherit' to define what other custom script to inherit from, and any other key name to define a default object field.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/CustomScriptContainer.java#L25 |
Name | Data Script Containers |
Description | Data script containers are generic script containers for information that will be referenced by other scripts.
No part of a 'data' script container is ever run as commands. There are no required keys. Generally, data is read using the ScriptTag.data_key tag.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/DataScriptContainer.java#L9 |
Name | Enchantment Script Containers |
Description | Enchantment 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).
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EnchantmentScriptContainer.java#L33 |
Name | Entity Script Containers |
Description | Entity script containers are an easy way to pre-define custom entities for use within scripts. Entity
scripts work with the EntityTag object, and can be fetched with the Object Fetcher by using the EntityTag constructor of simply the script name. Example: - spawn <player.location> MyEntity The following is the format for the container. Except for the 'entity_type' key (and the required 'type' key), all other keys are optional. You can also include a 'custom' key to hold any custom data attached to the script.
MORE MECHANISM OPTIONS ARE LISTED HERE: https://meta.denizenscript.com/Docs/Mechanisms/entitytag. |
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EntityScriptContainer.java#L27 |
Name | Format Script Containers |
Description | Format script containers are very simple script containers used for formatting messages, usually with the 'narrate' command.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java#L19 |
Name | Interact Script Containers |
Description | Interact script containers are used to handle NPC triggers.
Interact scripts must be referenced from an assignment script container to be of any use. See assignment script containers. The only required key on an interact script container is the 'steps:' key. Within the steps key is a list of steps, where the first step is '1', 'default', or any step that contains a '*' symbol. After that, any steps must be 'zapped' to via the zap command: zap. Each step contains a list of trigger types that it handles, and the relevant handling that the given trigger makes available. Refer to interact script triggers for documentation about the triggers available. Any triggers used must be enabled in assignment by trigger. Note that script commands ran in interact scripts by default have a delay between each command. To override this delay, set 'speed: 0' on the container or change the relevant config setting. Interact scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InteractScriptContainer.java#L19 |
Name | Inventory Script Containers |
Description | Inventory script containers are an easy way to pre-define custom inventories for use within scripts.
Inventory scripts work with the InventoryTag object, and can be fetched with the Object Fetcher by using the InventoryTag constructor InventoryTag_script_name. Example: - inventory open d:MyInventoryScript The following is the format for the container. The 'inventory:' key is required, other keys vary based on the type. Some types will require you define either 'size:' or 'slots:' (or both). 'Procedural items:' and 'definitions:' are optional, and should only be defined if needed.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/InventoryScriptContainer.java#L26 |
Name | Item Script Containers |
Description | Item 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.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/ItemScriptContainer.java#L30 |
Name | Map Script Containers |
Description | Map scripts allow you define custom in-game map items, for usage with the map command.
The following is the format for the container.
A list of cursor types is available through server.map_cursor_types. |
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/MapScriptContainer.java#L23 |
Name | Procedure Script Containers |
Description | Procedure script containers are used to define a script that can be ran through a tag.
Generally called via proc or proc.context. The only required key is 'script:'. Note that procedure scripts must NEVER change external state. That is, a procedure script cannot change anything at all, ONLY determine a value. Setting a flag, loading a YAML document, placing a block, etc. are all examples of external changes that are NOT allowed. This restriction comes from two main reasons: - Tags run in arbitrary conditions. They may be read asynchronously or in other weird circumstances that can result in applied changes crashing your server or other unexpected side effects. - Tags can run for a variety of reasons. If you were to make a proc script 'spawn_entity' that actually spawns an entity into the world, you would likely end up with a *lot* of unintentional entity spawns. Some tags will be read multiple times when theoretically ran once, in some circumstances a tag read might even be based on user input! (Particularly if you ever make use of the '.parsed' tag, or the list.parse/filter/sort_by_number tags). Imagine if for example, a tag can be read when users input a specific custom command, and a clever user finds out they can type "/testcommand 32 <proc[spawn_entity].context[creeper]>" to spawn a creeper ... that would be a major problem! In general, maximum caution is the best for situations like this... simply *never* make a procedure that executes external changes.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/ProcedureScriptContainer.java#L9 |
Name | Script Container |
Description | Script Containers are the basic structure that Denizen uses inside its YAML-based scripting files found in your
plugins/Denizen/scripts/ folder. Regardless of type, all script containers have basic parts that can usually be described as keys, list keys, parent keys, child keys, values, and list values. While specific container types probably have more specific names, just remember that no matter how complicated a script, this basic structure still applies. It's important to keep in mind that all child keys, including all the main keys of the script, must line up with one another, hierarchically. If you are familiar with YAML, great, because all script containers use it at the core. Every value, in one way or another, belongs to some kind of 'key'. To define a key, use a string value plus a colon (:). Keys can have a single value, a list value, or own another key:
And here's a container, put into a more familiar context:
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/ScriptContainer.java#L24 |
Name | Task Script Containers |
Description | Task script containers are generic script containers for commands that can be run at
any time by command. Generally tasks will be ran by run or inject. The only required key on a task script container is the 'script:' key.
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/TaskScriptContainer.java#L15 |
Name | World Script Containers |
Description | World script containers are generic script containers for commands that are automatically
ran when some given event happens in the server. The only required key is 'events:', within which you can list any events to handle. World scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).
|
Group | Script Container System |
Source | https://github.com/DenizenScript/Denizen-Core/blob/master/src/main/java/com/denizenscript/denizencore/scripts/containers/core/WorldScriptContainer.java#L9 |
Name | Economy Script Containers |
Description | Economy script containers
Economy script containers provide a Vault economy, which can be used in scripts by PlayerTag.money and money and as well by any other plugin that relies on economy functionality (such as shop plugins). Note that vault economy bank systems are not currently supported. Per-world economies are also not currently supported. Note that in most cases, you do not want to have multiple economy providers, as only one will actually be in use. ALL SCRIPT KEYS ARE REQUIRED. Economy scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).
|
Group | Script Container System |
Requires | Vault |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/EconomyScriptContainer.java#L32 |