diff --git a/src/main/java/com/fortlisa/mythicsk/skript/activemob/expressions/ExprGetEntity.java b/src/main/java/com/fortlisa/mythicsk/skript/activemob/expressions/ExprGetEntity.java new file mode 100644 index 0000000..41e4d84 --- /dev/null +++ b/src/main/java/com/fortlisa/mythicsk/skript/activemob/expressions/ExprGetEntity.java @@ -0,0 +1,38 @@ +package com.fortlisa.mythicsk.skript.activemob.expressions; + +import ch.njol.skript.doc.Description; +import ch.njol.skript.doc.Examples; +import ch.njol.skript.doc.Name; +import ch.njol.skript.expressions.base.SimplePropertyExpression; +import io.lumine.mythic.core.mobs.ActiveMob; +import org.bukkit.Bukkit; +import org.bukkit.entity.Entity; + +@Name("caster") +@Description({ + "Get the entity from the activemob. Returns a skript entity." +}) +@Examples({ + "set {_activeMob} to spawn mythicmob \"Gouliath\" at location of player", + "\nset {_mob} to entity of {_activeMob}" +}) +public class ExprGetEntity extends SimplePropertyExpression { + static { + register(ExprGetEntity.class, Entity.class, "entity", "activemob"); + } + + @Override + public Entity convert(ActiveMob activeMob) { + return activeMob.getEntity().getBukkitEntity(); + } + + @Override + protected String getPropertyName() { + return "entity"; + } + + @Override + public Class getReturnType() { + return Entity.class; + } +} diff --git a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetCaster.java b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetCaster.java similarity index 94% rename from src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetCaster.java rename to src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetCaster.java index 339991b..4edb5dd 100644 --- a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetCaster.java +++ b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetCaster.java @@ -1,4 +1,4 @@ -package com.fortlisa.mythicsk.skript.skill.expressions; +package com.fortlisa.mythicsk.skript.skilldata.expressions; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Examples; diff --git a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetEntityTargets.java b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetEntityTargets.java similarity index 97% rename from src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetEntityTargets.java rename to src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetEntityTargets.java index ba3a0a9..a2f13e7 100644 --- a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetEntityTargets.java +++ b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetEntityTargets.java @@ -1,4 +1,4 @@ -package com.fortlisa.mythicsk.skript.skill.expressions; +package com.fortlisa.mythicsk.skript.skilldata.expressions; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; diff --git a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetMetadata.java b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetMetadata.java similarity index 97% rename from src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetMetadata.java rename to src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetMetadata.java index 1775e8d..61dd247 100644 --- a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetMetadata.java +++ b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetMetadata.java @@ -1,4 +1,4 @@ -package com.fortlisa.mythicsk.skript.skill.expressions; +package com.fortlisa.mythicsk.skript.skilldata.expressions; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; diff --git a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTargetLocations.java b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTargetLocations.java similarity index 97% rename from src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTargetLocations.java rename to src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTargetLocations.java index b0eae8c..bd61795 100644 --- a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTargetLocations.java +++ b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTargetLocations.java @@ -1,4 +1,4 @@ -package com.fortlisa.mythicsk.skript.skill.expressions; +package com.fortlisa.mythicsk.skript.skilldata.expressions; import ch.njol.skript.Skript; import ch.njol.skript.doc.Description; diff --git a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTrigger.java b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTrigger.java similarity index 94% rename from src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTrigger.java rename to src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTrigger.java index b06a3be..3a00f74 100644 --- a/src/main/java/com/fortlisa/mythicsk/skript/skill/expressions/ExprGetTrigger.java +++ b/src/main/java/com/fortlisa/mythicsk/skript/skilldata/expressions/ExprGetTrigger.java @@ -1,4 +1,4 @@ -package com.fortlisa.mythicsk.skript.skill.expressions; +package com.fortlisa.mythicsk.skript.skilldata.expressions; import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Examples;