From cd3a7827ecf252454fbc9a9e36db05fc1b6cb0a1 Mon Sep 17 00:00:00 2001 From: mcmonkey Date: Wed, 11 Jul 2018 20:12:51 -0700 Subject: [PATCH] allow 'custom' key on entity scripts --- .../scripts/containers/core/EntityScriptContainer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/net/aufdemrand/denizen/scripts/containers/core/EntityScriptContainer.java b/plugin/src/main/java/net/aufdemrand/denizen/scripts/containers/core/EntityScriptContainer.java index 444aaec631..b6afe3df2d 100644 --- a/plugin/src/main/java/net/aufdemrand/denizen/scripts/containers/core/EntityScriptContainer.java +++ b/plugin/src/main/java/net/aufdemrand/denizen/scripts/containers/core/EntityScriptContainer.java @@ -28,6 +28,8 @@ public class EntityScriptContainer extends ScriptContainer { // The following is the format for the container. Except for the 'entity_type' key (and the dScript // required 'type' key), all other keys are optional. // + // You can also include a 'custom' key to hold any custom yaml data attached to the script. + // // // # The name of the entity script is the same name that you can use to construct a new // # dEntity based on this entity script. For example, an entity script named 'space zombie' @@ -39,6 +41,8 @@ public class EntityScriptContainer extends ScriptContainer { // # Must be a valid dEntity (EG e@zombie or e@pig[age=baby]) See 'dEntity' for more information. // entity_type: e@base_entity // + // # Samples of mechanisms to use (any valid dEntity mechanisms may be listed like this): + // // # Whether the entity has the default AI // has_ai: true/false // @@ -72,7 +76,7 @@ public dEntity getEntityFrom(dPlayer player, dNPC npc) { Set strings = getConfigurationSection("").getKeys(false); for (StringHolder string : strings) { - if (!string.low.equals("entity_type") && !string.low.equals("type") && !string.low.equals("debug")) { + if (!string.low.equals("entity_type") && !string.low.equals("type") && !string.low.equals("debug") && !string.low.equals("custom")) { String value = TagManager.tag((getString(string.low, "")), new BukkitTagContext (player, npc, false, null, shouldDebug(), new dScript(this))); entity.adjust(new Mechanism(new Element(string.low), new Element(value)));