Nomove
Запрещает игрокам перемещать предметы в любых слотах инвентаря.
- Загрузчики
- FabricNeoForge
- Скачиваний на Modrinth
- 298
- Подписчиков на Modrinth
- 2
- версий
- 12
- Обновлён
- 24 октября 202624 окт.
- Опубликован
- в 2026
Коротко о моде
Нужен и в игре, и на сервере
NoMove — лёгкий мод для одиночной игры на Minecraft 1.21.1/26.3, разработанный для загрузчиков NeoForge/Fabric. Главная особенность мода — полностью запретить игрокам перемещать предметы любым способом, включая перемещение, обмен и передачу предметов внутри инвентарей, а также выбрасывание предметов, что в корне ограничивает манипуляции с предметами. Мод реализован через технологию Mixin, внедряемую в базовый класс Slot, и не требует сложной настройки — он начинает работать сразу после установки. Будь то инвентарь игрока, сундуки, печи или любой другой интерфейс контейнера, любое перетаскивание предметов и перемещение кликом будет перехвачено, что эффективно предотвращает случайные операции с предметами и сохраняет раскладку инвентаря неизменной. Подходит для одиночных сценариев, требующих строгого контроля над потоком предметов, например для челлендж-геймплея, выживания по особым правилам, карт-головоломок и многого другого. NoMoveMod.java
package com.nomove;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.minecraft.commands.Commands;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageType;
import net.minecraft.world.entity.player.Player;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.RegisterCommandsEvent;
@Mod(NoMoveMod.MODID)
public class NoMoveMod {
public static final String MODID = "nomove";
public static final ResourceKey<DamageType> EXECUTION_DAMAGE = ResourceKey.create(
Registries.DAMAGE_TYPE,
ResourceLocation.fromNamespaceAndPath(MODID, "execution")
);
public NoMoveMod(ModContainer container) {
container.registerConfig(ModConfig.Type.CLIENT, NoMoveConfig.SPEC, "nomove-client.toml");
NeoForge.EVENT_BUS.addListener(this::registerCommands);
}
public static void executeKill(Player player) {
DamageSource source = player.damageSources().source(EXECUTION_DAMAGE);
player.hurt(source, Float.MAX_VALUE);
}
private void registerCommands(RegisterCommandsEvent event) {
event.getDispatcher().register(
Commands.literal("nomove")
.requires(source -> source.hasPermission(2))
.then(Commands.literal("config_client")
.then(Commands.literal("moving_items")
.then(Commands.argument("value", StringArgumentType.word())
.suggests((ctx, builder) -> {
builder.suggest("true");
builder.suggest("false");
return builder.buildFuture();
})
.executes(context -> {
ServerPlayer player = context.getSource().getPlayer();
boolean isChinese = player != null && player.clientInformation().language().startsWith("zh");
String val = StringArgumentType.getString(context, "value").toLowerCase();
boolean boolVal;
if (val.equals("true")) {
boolVal = true;
} else if (val.equals("false")) {
boolVal = false;
} else {
if (isChinese) {
context.getSource().sendFailure(Component.literal("§c参数错误!只能是 true 或 false"));
} else {
context.getSource().sendFailure(Component.literal("§cInvalid argument! Must be true or false"));
}
return 0;
}
NoMoveConfig.MOVING_ITEMS.set(boolVal);
String statusColor = boolVal ? "§a" : "§c";
String statusText = String.valueOf(boolVal);
if (isChinese) {
context.getSource().sendSuccess(() ->
Component.literal("§eNoMove: 移动物品拦截已设置为 " + statusColor + statusText), true);
} else {
context.getSource().sendSuccess(() ->
Component.literal("§eNoMove: Moving items prevention set to " + statusColor + statusText), true);
}
return 1;
})
)
)
)
);
}
}NoMoveConfig.java
package com.nomove;
import net.neoforged.neoforge.common.ModConfigSpec;
public class NoMoveConfig {
private static final ModConfigSpec.Builder BUILDER = new ModConfigSpec.Builder();
public static final ModConfigSpec.BooleanValue MOVING_ITEMS = BUILDER
.comment("Set to true to prevent moving items, false to allow it.")
.define("moving_items", true);
public static final ModConfigSpec SPEC = BUILDER.build();
}PlayerMixin.java
package com.nomove.mixin;
import com.nomove.NoMoveMod; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.player.Player; 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(Player.class) public abstract class PlayerMixin {
@Inject(method = "hurt", at = @At("HEAD"), cancellable = true) private void nomove$forceKillCreative(DamageSource source, float amount, CallbackInfoReturnable cir) { if (source.is(NoMoveMod.EXECUTION_DAMAGE)) { Player player = (Player) (Object) this;
if (player.getAbilities().instabuild) { player.getAbilities().instabuild = false; boolean result = player.hurt(source, amount); if (player.isAlive()) { player.getAbilities().instabuild = true; } cir.setReturnValue(result); } } } }
**SlotMixin.java**package com.nomove.mixin;
import com.nomove.NoMoveConfig; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; 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(Slot.class) public abstract class SlotMixin {
@Inject(method = "mayPickup", at = @At("HEAD"), cancellable = true) private void nomove$preventPickup(Player player, CallbackInfoReturnable cir) { if (NoMoveConfig.MOVING_ITEMS.get()) { cir.setReturnValue(false); } }
@Inject(method = "mayPlace", at = @At("HEAD"), cancellable = true) private void nomove$preventPlace(ItemStack stack, CallbackInfoReturnable cir) { if (NoMoveConfig.MOVING_ITEMS.get()) { cir.setReturnValue(false); } } }
Частые вопросы
Как установить Nomove?
Установите Fabric под свою версию Minecraft, скачайте Nomove под ту же версию и загрузчик, положите файл в папку mods и запустите игру с профилем загрузчика.
Для каких версий Minecraft есть Nomove?
У Nomove есть сборки для Minecraft 1.21.1, 26.3.
Нужен ли Nomove на сервере?
Нужен и в игре, и на сервере