Skip to content

Commit

Permalink
fix spawn command spawned_entity save entry
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 13, 2019
1 parent 96d072e commit 5ea7210
Showing 1 changed file with 3 additions and 7 deletions.
Expand Up @@ -105,11 +105,7 @@ public void execute(final ScriptEntry scriptEntry) {

entity.spawnAt(loc);

// Only add to entityList after the entities have been
// spawned, otherwise you'll get something like "e@skeleton"
// instead of "e@57" on it

entityList.add(entity.toString());
entityList.addObject(entity);

if (persistent && entity.isLivingEntity()) {
entity.getLivingEntity().setRemoveWhenFarAway(false);
Expand All @@ -124,8 +120,8 @@ public void execute(final ScriptEntry scriptEntry) {
// can be fetched.

scriptEntry.addObject("spawned_entities", entityList);
if (entityList.size() != 0) {
scriptEntry.addObject("spawned_entity", entityList.get(0));
if (entities.size() != 0) {
scriptEntry.addObject("spawned_entity", entities.get(0));
}
}
}

0 comments on commit 5ea7210

Please sign in to comment.