Skip to content

Commit

Permalink
better command script tab complete example
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 21, 2020
1 parent 481f9ad commit 500c53f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Expand Up @@ -164,7 +164,7 @@ public void adjust(Mechanism mechanism) {
// <--[mechanism]
// @object EntityTag
// @name max_health
// @input ElementTag(Number)
// @input ElementTag(Decimal)
// @description
// Sets the maximum health the entity may have.
// The entity must be living.
Expand Down
Expand Up @@ -88,7 +88,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// @mechanism EntityTag.painting
// @group properties
// @description
// If the entity is a painting, returns what art it shows.
// If the entity is a painting, returns what art it shows. Art types: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Art.html>.
// -->
if (attribute.startsWith("painting")) {
return new ElementTag(((Painting) painting.getBukkitEntity()).getArt().name())
Expand All @@ -106,7 +106,7 @@ public void adjust(Mechanism mechanism) {
// @name painting
// @input ElementTag
// @description
// Changes the art shown by a painting.
// Changes the art shown by a painting. Valid a types: <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Art.html>.
// @tags
// <EntityTag.painting>
// -->
Expand Down
Expand Up @@ -105,7 +105,17 @@ public class CommandScriptContainer extends ScriptContainer {
// tab complete:
// - if !<player.is_op||<context.server>>:
// - stop
// - determine <server.online_players.parse[name].include[pizza|potato|anchovy].filter[starts_with[<context.args.last>]]>
// # This is a (temporary until we have something better) trick to figure out which arg is being typed in
// - choose "<context.raw_args.to_list.count[ ]>":
// # The first argument
// - case 0:
// - determine alpha|beta
// # The second argument
// - case 1:
// - determine <server.online_players.parse[name].include[pizza|potato|anchovy].filter[starts_with[<context.args.last>]]>
// # All additional arguments
// - default:
// - determine <list>
//
// # The script that will run when the command is executed.
// # No, you do not need '- determine fulfilled' or anything of the sort, since the command is fully registered.
Expand Down

0 comments on commit 500c53f

Please sign in to comment.