Search in sources :

Example 11 with ElementTag

use of com.denizenscript.denizencore.objects.core.ElementTag in project Denizen-For-Bukkit by DenizenScript.

the class CreeperPoweredScriptEvent method onCreeperPowered.

@EventHandler
public void onCreeperPowered(CreeperPowerEvent event) {
    lightning = new EntityTag(event.getLightning());
    entity = new EntityTag(event.getEntity());
    cause = new ElementTag(event.getCause().name());
    this.event = event;
    fire(event);
}
Also used : EntityTag(com.denizenscript.denizen.objects.EntityTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag) EventHandler(org.bukkit.event.EventHandler)

Example 12 with ElementTag

use of com.denizenscript.denizencore.objects.core.ElementTag in project Denizen-For-Bukkit by DenizenScript.

the class EntityBreaksHangingScriptEvent method onHangingBreaks.

@EventHandler
public void onHangingBreaks(HangingBreakByEntityEvent event) {
    hanging = new EntityTag(event.getEntity());
    cause = new ElementTag(event.getCause().name());
    location = new LocationTag(hanging.getLocation());
    breaker = new EntityTag(event.getRemover());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) EntityTag(com.denizenscript.denizen.objects.EntityTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag) EventHandler(org.bukkit.event.EventHandler)

Example 13 with ElementTag

use of com.denizenscript.denizencore.objects.core.ElementTag in project Denizen-For-Bukkit by DenizenScript.

the class EntityDamagedScriptEvent method onEntityDamaged.

@EventHandler
public void onEntityDamaged(EntityDamageEvent event) {
    entity = new EntityTag(event.getEntity());
    cause = new ElementTag(CoreUtilities.toLowerCase(event.getCause().name()));
    damager = null;
    projectile = null;
    held = null;
    if (event instanceof EntityDamageByEntityEvent) {
        damager = new EntityTag(((EntityDamageByEntityEvent) event).getDamager());
        if (damager.isProjectile()) {
            projectile = damager;
            if (damager.hasShooter()) {
                damager = damager.getShooter();
            }
        }
        if (damager != null) {
            held = damager.getItemInHand();
            if (held != null) {
                held.setAmount(1);
            }
        }
    }
    this.event = event;
    fire(event);
}
Also used : EntityDamageByEntityEvent(org.bukkit.event.entity.EntityDamageByEntityEvent) EntityTag(com.denizenscript.denizen.objects.EntityTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag) EventHandler(org.bukkit.event.EventHandler)

Example 14 with ElementTag

use of com.denizenscript.denizencore.objects.core.ElementTag in project Denizen-For-Bukkit by DenizenScript.

the class HorseJumpsScriptEvent method onHorseJumps.

@EventHandler
public void onHorseJumps(HorseJumpEvent event) {
    entity = new EntityTag(event.getEntity());
    color = event.getEntity() instanceof Horse ? new ElementTag(((Horse) event.getEntity()).getColor().name()) : null;
    this.event = event;
    fire(event);
}
Also used : Horse(org.bukkit.entity.Horse) EntityTag(com.denizenscript.denizen.objects.EntityTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag) EventHandler(org.bukkit.event.EventHandler)

Example 15 with ElementTag

use of com.denizenscript.denizencore.objects.core.ElementTag in project Denizen-For-Bukkit by DenizenScript.

the class EntityTargetsScriptEvent method onEntityTargets.

@EventHandler
public void onEntityTargets(EntityTargetEvent event) {
    entity = new EntityTag(event.getEntity());
    reason = new ElementTag(event.getReason().toString());
    target = event.getTarget() != null ? new EntityTag(event.getTarget()) : null;
    location = new LocationTag(event.getEntity().getLocation());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) EntityTag(com.denizenscript.denizen.objects.EntityTag) ElementTag(com.denizenscript.denizencore.objects.core.ElementTag) EventHandler(org.bukkit.event.EventHandler)

Aggregations

ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)237 ListTag (com.denizenscript.denizencore.objects.core.ListTag)86 EntityTag (com.denizenscript.denizen.objects.EntityTag)66 LocationTag (com.denizenscript.denizen.objects.LocationTag)49 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)48 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)43 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)40 List (java.util.List)40 Argument (com.denizenscript.denizencore.objects.Argument)28 Player (org.bukkit.entity.Player)28 MapTag (com.denizenscript.denizencore.objects.core.MapTag)27 EventHandler (org.bukkit.event.EventHandler)26 NPCTag (com.denizenscript.denizen.objects.NPCTag)24 ObjectTag (com.denizenscript.denizencore.objects.ObjectTag)22 ItemTag (com.denizenscript.denizen.objects.ItemTag)19 ScriptTag (com.denizenscript.denizencore.objects.core.ScriptTag)18 ArrayList (java.util.ArrayList)16 Entity (org.bukkit.entity.Entity)16 MaterialTag (com.denizenscript.denizen.objects.MaterialTag)12 ScriptEntry (com.denizenscript.denizencore.scripts.ScriptEntry)12