Exemplo n.º 1
0
 public void destroy() {
   entity.remove();
   CustomEntityHandler.unRegister(this.entity);
   this.name = null;
   this.entity = null;
   this.random = null;
   this.plugin = null;
 }
Exemplo n.º 2
0
  public CustomEntity(LivingEntity entity, Plugin plugin) {
    this.entity = entity;
    this.level = getZoneLevel();
    this.plugin = plugin;

    CustomEntityHandler.register(this.entity, this.entity.getUniqueId(), this);
    if (entity.getType() == EntityType.ZOMBIE || entity.getType() == EntityType.SKELETON) {
      this.setLeveledArmor();
    }
    this.autoLevel();
  }
Exemplo n.º 3
0
 public static CustomEntity spawn(EntityType type, Location loc, int level) {
   Entity entity = loc.getWorld().spawnEntity(loc, type);
   CustomEntityHandler.getCustomEntity(entity).setLevel(level);
   return CustomEntityHandler.getCustomEntity(entity);
 }
Exemplo n.º 4
0
 @SuppressWarnings("unused")
 public void onDeath(EntityDeathEvent event) {
   CustomEntityHandler.unRegister(this.entity);
   Location loc = this.entity.getLocation();
   dropExp(entity, level * 6);
 }