Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Listener
- public void onEntitySpawn(SpawnEntityEvent event){
- Entity spawnedEntity = null;
- for(Entity entity : event.getEntities()) {
- if(entity != null) {
- spawnedEntity = entity;
- break;
- }
- }
- if(spawnedEntity == null){
- //no no-null entity was found
- return;
- }
- Sponge.getServer().getBroadcastChannel().send(Text.of("A "+ spawnedEntity.getType() +" has just been spawned."));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement