crwdns132653:0crwdne132653:0

crwdns132655:0:javadoc:crwdnd132655:0:javadoc:crwdnd132655:0:javadoc:crwdnd132655:0:javadoc:crwdne132655:0

crwdns132657:0crwdne132657:0

import org.spongepowered.api.entity.Entity;
import org.spongepowered.api.entity.EntityTypes;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.entity.spawn.SpawnCause;
import org.spongepowered.api.event.cause.entity.spawn.SpawnTypes;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;

import java.util.Optional;

public void spawnEntity(Location<World> spawnLocation) {
    World world = spawnLocation.getExtent();
    Entity creeper = world
        .createEntity(EntityTypes.CREEPER, spawnLocation.getPosition());
    SpawnCause spawnCause = SpawnCause.builder().type(SpawnTypes.PLUGIN).build();
    world.spawnEntity(creeper, Cause.source(spawnCause).build());
}

crwdns132659:0:javadoc:crwdne132659:0

crwdns132661:0:javadoc:crwdnd132661:0:javadoc:crwdnd132661:0:javadoc:crwdne132661:0