跳到正文

NoBadBooms

作者:JayMing

A server-side NeoForge 1.21.1 mod that adds a tntExplodes gamerule, similar to Bedrock Edition, letting you stop TNT from destroying blocks.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

NoBadBooms!

A server-side NeoForge 1.21.1 mod that adds a tntExplodes gamerule, similar to
Bedrock Edition, letting you stop TNT from destroying blocks.

Usage

/gamerule tntExplodes false

When false, TNT blocks and TNT minecarts still ignite and detonate (fuse, sound,
particles, knockback, and entity damage all still happen), but **no blocks are
destroyed**. Default is true (vanilla behavior).

The rule is per-world and saved like any vanilla gamerule.

Note: this differs slightly from Bedrock, where tntExplodes false prevents TNT

from igniting at all. Here the explosion still occurs – only terrain damage is

disabled. Other explosion sources (creepers, ghasts, beds, end crystals) are

unaffected; creepers are already covered by vanilla’s mobGriefing.

Server-side only

Install the jar in the server’s mods folder. Vanilla / unmodded clients can
join normally. It also works in single-player if installed on a client.

How it works

  • Registers the gamerule with GameRules.register("tntExplodes", Category.MISC, BooleanValue.create(true)) during mod class initialization (NeoForge’s access transformers make these public).
  • Listens to ExplosionEvent.Detonate, which fires after the explosion has computed its affected blocks but before anything is destroyed. If the explosion’s direct source entity is a PrimedTnt or MinecartTNT and the gamerule is false, the affected-block list is cleared.

Note: This was to solve an issue with a minigame on my server. I don’t know if I will ever update it. I don’t imagine it will be hard to update, so, feel free to compile from source and change however you want. It’s a tool, use it if you need.

常见问题

NoBadBooms 支持哪些 Minecraft 版本?

NoBadBooms 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

NoBadBooms 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。

评论

登录后评论和评分

JayMing 的其他作品

查看全部 →