package net.kelsoncraft.test; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.minecraft.text.Text; public class CommandTest { // This doesn't work at all in other classes. // // CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> dispatcher.register(literal("test") // .executes(context -> { // // For versions below 1.19, replace "Text.literal" with "new LiteralText". // // For versions below 1.20, remode "() ->" directly. // context.getSource().sendFeedback(() -> Text.literal("Called /test with no arguments"), false); // // // return 1; // }))); }