Dan_Ender

Untitled

Aug 15th, 2017
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. public void spawnEntity(Location loc,EntityType type,String customName, double hp, int
  2.     Entity entity = loc.getWorld().spawnEntity(loc, type);
  3.     entity.setCustomName(customName);
  4.     if (!(entity instanceof LivingEntity)) return;
  5.     LivingEntity livingEntity = (LivingEntity) entity;
  6.     livingEntity.setHealth(hp);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment