Advertisement
Rob5Underscores

Untitled

Jan 22nd, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. @Listener
  2. public void onEntitySpawn(SpawnEntityEvent event){
  3. Entity spawnedEntity = null;
  4. for(Entity entity : event.getEntities()) {
  5. if(entity != null) {
  6. spawnedEntity = entity;
  7. break;
  8. }
  9. }
  10. if(spawnedEntity == null){
  11. //no no-null entity was found
  12. return;
  13. }
  14. Sponge.getServer().getBroadcastChannel().send(Text.of("A "+ spawnedEntity.getType() +" has just been spawned."));
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement