Skip to content

Commit

Permalink
add shoot comand "shot_entity" quick tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 5, 2020
1 parent a62cc53 commit 60319c8
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -68,6 +68,7 @@ public class ShootCommand extends AbstractCommand implements Listener, Holdable
// The shoot command is ~waitable. Refer to <@link language ~waitable>.
//
// @Tags
// <entry[saveName].shot_entity> returns the single entity that was shot (as in, the projectile) (if you only shot one).
// <entry[saveName].shot_entities> returns a ListTag of entities that were shot (as in, the projectiles).
//
// @Usage
Expand Down Expand Up @@ -278,6 +279,9 @@ public void execute(final ScriptEntry scriptEntry) {
// Add entities to context so that the specific entities created/spawned
// can be fetched.
scriptEntry.addObject("shot_entities", entityList);
if (entityList.size() == 1) {
scriptEntry.addObject("shot_entity", entityList.getObject(0));
}

if (spread == null) {
Position.mount(Conversion.convertEntities(entities));
Expand Down

0 comments on commit 60319c8

Please sign in to comment.