Skip to content

EntityBuilder

Nont Nonnipat edited this page Dec 18, 2024 · 2 revisions

EntityBuilder

You can setup an entity using EntityBuilder.

Differences

  1. EntityBuilder has provided the way to initialize an Entity without spawning it into world.
  2. Using EntityBuilder to spawn an entity is Easier than using Bukkit spawning way.

How to spawn an Entity

// Rest of the Code.

  EntityBuilder exZombieEntity = new EntityBuilder(EntityType.ALLAY).setPersistent(true);
  exZombieEntity.spawn(new Location(Bukkit.getWorld("world"), 0, 0, 0));

// Rest of the Code.

Method

  • addPassenger(Entity entity)

  • addScoreboardTag(String[] tag)

  • setFireTicks(int i)

  • setGlowing(boolean bool)

  • setInvulnerable(boolean bool)

  • setSilent(boolean bool)

  • hasGravity(boolean bool)

  • setVelocity(Vector vec)

  • setPersistent(Boolean bool)

  • setFreezingTicks(int i)

  • setCustomNameVisible(Boolean bool)

  • setPortalCooldown(int i)

  • setFallingDistance(float f)

  • setRotation(float yaw, float pitch)

  • setTicksLived(int i)

  • setVisibleByDefault(boolean bool)

  • setVisualFire(boolean bool)

  • spawn(Location loc)

  • spawn(World world, double x, double y, double z)

Method Detail

addPassenger

EntityBuilder addPassenger(Entity entity)

Add passenger to an entity Vehicle

Parameter: entity - passenger

Returns: EntityBuilder

Coming soon full version on 2025!

Clone this wiki locally