From 14c68eb5ba16774f581d95a39e64a7b303954ffc Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Sat, 26 Sep 2026 17:05:36 +1200 Subject: migration to 26.2 - run migrateMappings with old loom then bring it back to new --- .../arslaansmagichax/commands/HackXP.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/com/arslaancodes/arslaansmagichax/commands/HackXP.java (limited to 'src/main/java/com/arslaancodes/arslaansmagichax/commands/HackXP.java') diff --git a/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackXP.java b/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackXP.java new file mode 100644 index 0000000..024f5c4 --- /dev/null +++ b/src/main/java/com/arslaancodes/arslaansmagichax/commands/HackXP.java @@ -0,0 +1,30 @@ +package com.arslaancodes.arslaansmagichax.commands; + +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.IntegerArgumentType; +import com.mojang.brigadier.arguments.StringArgumentType; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.minecraft.client.Minecraft; +import net.minecraft.commands.CommandBuildContext; + +public class HackXP { + public static void register(CommandDispatcher dispatcher, CommandBuildContext access) { + dispatcher.register(ClientCommandManager.literal("hackxp") + .then(ClientCommandManager.argument("xp", IntegerArgumentType.integer()) + .executes(HackXP::run) + ) + ); + } + + private static int run(CommandContext context) throws CommandSyntaxException { + int xp = IntegerArgumentType.getInteger(context,"xp"); + + if (Minecraft.getInstance().player == null) return -1; + Minecraft.getInstance().player.experienceLevel += xp; + + return 1; + } +} -- cgit v1.2.3