Skip to content

Commit 138bfe8

Browse files
committed
Add subcommand to modify the Vita scoreboard component
1 parent 7e699c2 commit 138bfe8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/testmod/java/org/ladysnake/componenttest/content/VitaCommand.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
5050
return 1;
5151
})
5252
)
53+
.then(CommandManager.literal("serverwide")
54+
.executes(commandContext -> {
55+
Vita.get(commandContext.getSource().getServer().getScoreboard()).setVitality(IntegerArgumentType.getInteger(commandContext, "amount"));
56+
commandContext.getSource().sendFeedback(() -> Text.of("success!"), false);
57+
return 1;
58+
}))
5359
)
5460
)
5561
.then(CommandManager.literal("get")

0 commit comments

Comments
 (0)