DisableProfessions

Pasted Nov 14, 2026, 3:33 PM1 file51 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgs58dg1v88gfr0
DisableProfessions
mauwachtel.disable_professsions;

import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.minecraft.commands.Commands;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DisableProfessions implements ModInitializer {
	public static final String MOD_ID = "disable_professions";
	public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

	@Override
	public void onInitialize() {
		CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
			dispatcher.register(
					Commands.literal("test_command")
							.then(Commands.literal("disable")
									.then(Commands.argument("job_type", StringArgumentType.word())
											.executes(context ->
													ProfessionsCommand.runDisable(
															context,
															StringArgumentType.getString(context, "job_type")
													)
											)
									)
							)
							.then(Commands.literal("enable")
									.then(Commands.argument("job_type", StringArgumentType.word())
											.executes(context ->
													ProfessionsCommand.runEnable(
															context,
															StringArgumentType.getString(context, "job_type")
													)
											)
									)
							)
							.executes(ProfessionsCommand::runError)
			);
		});
	}

	public static Identifier id(String path) {
		return Identifier.fromNamespaceAndPath(MOD_ID, path);
	}
}

1,594 chars · codepastes.com