Search in sources :

Example 31 with EntityTag

use of com.denizenscript.denizen.objects.EntityTag in project Denizen-For-Bukkit by DenizenScript.

the class EntityTransformScriptEvent method onEntityTransform.

@EventHandler
public void onEntityTransform(EntityTransformEvent event) {
    this.event = event;
    originalEntity = new EntityTag(event.getEntity());
    fire(event);
}
Also used : EntityTag(com.denizenscript.denizen.objects.EntityTag) EventHandler(org.bukkit.event.EventHandler)

Example 32 with EntityTag

use of com.denizenscript.denizen.objects.EntityTag in project Denizen-For-Bukkit by DenizenScript.

the class PigZappedScriptEvent method onPigZapped.

@EventHandler
public void onPigZapped(PigZapEvent event) {
    pig = new EntityTag(event.getEntity());
    Entity pigZombie = event.getPigZombie();
    EntityTag.rememberEntity(pigZombie);
    pig_zombie = new EntityTag(pigZombie);
    lightning = new EntityTag(event.getLightning());
    this.event = event;
    fire(event);
    EntityTag.forgetEntity(pigZombie);
}
Also used : Entity(org.bukkit.entity.Entity) EntityTag(com.denizenscript.denizen.objects.EntityTag) EventHandler(org.bukkit.event.EventHandler)

Example 33 with EntityTag

use of com.denizenscript.denizen.objects.EntityTag in project Denizen-For-Bukkit by DenizenScript.

the class ProjectileHitsBlockScriptEvent method onProjectileHits.

@EventHandler
public void onProjectileHits(ProjectileHitEvent event) {
    projectile = new EntityTag(event.getEntity());
    if (projectile.getLocation() == null) {
        // No, I can't explain how or why this would ever happen... nonetheless, it appears it does happen sometimes.
        return;
    }
    if (Double.isNaN(projectile.getLocation().getDirection().normalize().getX())) {
        // I can't explain this one either. It also chooses to happen whenever it pleases.
        return;
    }
    Block block = event.getHitBlock();
    if (block == null) {
        return;
    }
    material = new MaterialTag(block);
    shooter = projectile.getShooter();
    location = new LocationTag(block.getLocation());
    this.event = event;
    fire(event);
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) LocationTag(com.denizenscript.denizen.objects.LocationTag) Block(org.bukkit.block.Block) EntityTag(com.denizenscript.denizen.objects.EntityTag) EventHandler(org.bukkit.event.EventHandler)

Example 34 with EntityTag

use of com.denizenscript.denizen.objects.EntityTag in project Denizen-For-Bukkit by DenizenScript.

the class ProjectileLaunchedScriptEvent method onProjectileLaunched.

@EventHandler
public void onProjectileLaunched(ProjectileLaunchEvent event) {
    Entity projectile = event.getEntity();
    EntityTag.rememberEntity(projectile);
    this.projectile = new EntityTag(projectile);
    location = new LocationTag(event.getEntity().getLocation());
    this.event = event;
    fire(event);
    EntityTag.forgetEntity(projectile);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) Entity(org.bukkit.entity.Entity) EntityTag(com.denizenscript.denizen.objects.EntityTag) EventHandler(org.bukkit.event.EventHandler)

Example 35 with EntityTag

use of com.denizenscript.denizen.objects.EntityTag in project Denizen-For-Bukkit by DenizenScript.

the class SheepRegrowsScriptEvent method onSheepRegrows.

@EventHandler
public void onSheepRegrows(SheepRegrowWoolEvent event) {
    entity = new EntityTag(event.getEntity());
    location = new LocationTag(entity.getLocation());
    this.event = event;
    fire(event);
}
Also used : LocationTag(com.denizenscript.denizen.objects.LocationTag) EntityTag(com.denizenscript.denizen.objects.EntityTag) EventHandler(org.bukkit.event.EventHandler)

Aggregations

EntityTag (com.denizenscript.denizen.objects.EntityTag)142 EventHandler (org.bukkit.event.EventHandler)81 ElementTag (com.denizenscript.denizencore.objects.core.ElementTag)56 LocationTag (com.denizenscript.denizen.objects.LocationTag)45 List (java.util.List)27 Entity (org.bukkit.entity.Entity)25 ItemTag (com.denizenscript.denizen.objects.ItemTag)17 ListTag (com.denizenscript.denizencore.objects.core.ListTag)17 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)15 InvalidArgumentsException (com.denizenscript.denizencore.exceptions.InvalidArgumentsException)12 DurationTag (com.denizenscript.denizencore.objects.core.DurationTag)11 NPCTag (com.denizenscript.denizen.objects.NPCTag)10 ArrayList (java.util.ArrayList)10 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)10 ScriptEntry (com.denizenscript.denizencore.scripts.ScriptEntry)9 Player (org.bukkit.entity.Player)9 MaterialTag (com.denizenscript.denizen.objects.MaterialTag)8 Argument (com.denizenscript.denizencore.objects.Argument)8 LivingEntity (org.bukkit.entity.LivingEntity)8 Item (org.bukkit.entity.Item)7