package party._2a03.mc.mixin; import java.util.Collection; import com.mojang.brigadier.context.CommandContext; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.GameModeCommand; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.LiteralText; import net.minecraft.world.GameMode; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(GameModeCommand.class) public class MixinGameModeCommand { @Inject(method = "execute", at = @At("HEAD")) private static void OnExecute(CommandContext context, Collection targets, GameMode gameMode, CallbackInfoReturnable cir) { if (gameMode == GameMode.CREATIVE) { context.getSource().sendFeedback(new LiteralText(" Creative mode? What are you, a cheater?"), false); } return; } }