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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations