Dynamic Surroundings (Expanded) Mixins
A Mixin patch mod for Dynamic Surroundings (Expanded) (CurseForge) that fixes its failure to properly recognize tool/weapon sound effects from certain mods on Minecraft Forge 1.20.1.
介绍
Dynamic Surroundings (Expanded) Mixins
A Mixin patch mod for Dynamic Surroundings (Expanded) (CurseForge) that fixes its failure to properly recognize tool/weapon sound effects from certain mods on Minecraft Forge 1.20.1.
Patches are injected at runtime via Mixin.
Core Features
- Fixes missing switching sounds and sword hum sounds for tools/weapons from mods like Tinkers’ Construct 3.
- Specifically: lets Dynamic Surroundings correctly classify items as sword / axe / tool… based on item tags (e.g.
#minecraft:swords) instead of relying only on class inheritance.
Root Cause
- Dynamic Surroundings’
ItemLibrary#resolveClassType()determines item type using onlyinstanceofagainst vanilla item classes — it never uses item tags (#minecraft:swords, etc.). - Tinkers’ Construct 3 swords inherit as (roughly):
ModifiableSwordItem → ModifiableItem → TieredItem
- They are not
SwordItem, butTieredItem. Thus:
| Mod’s sword | Inherits | Resolved as | Sound |
|---|---|---|---|
| Ice and Fire / Twilight Forest | SwordItem |
SWORD |
Sword hum plays |
| Tinkers’ Construct 3 | TieredItem |
TOOL |
Tool sound; no sword hum |
- So Tinkers’ swords appear silent — they were simply misclassified as tools.
In fact, Dynamic Surroundings already defines these tags (
ItemEffectTags.SWORDS, etc., andeffects/swords.jsonmapped to#minecraft:swords/#c:swords) — it just forgot to use them inresolveClassType.
The Fix
A Mixin is injected at the HEAD of ItemLibrary#resolveClassType, applying tag-based classification before the instanceof check (preemptive interception):
- When the method is called, the tag check runs first.
- Tag matches →
setReturnValuereturns the correct type immediately; the originalinstanceoflogic is skipped. - No tag match → nothing happens; the original
instanceoflogic runs unchanged.
Therefore:
- Vanilla items behave identically (tag result matches
instanceof). - Items like Tinkers’ (
TieredItembut carrying#minecraft:swords) are correctly classified as swords. - All other Dynamic Surroundings features (books, potions, ambient/environment, footsteps, etc.) are unaffected.
Extra Patches
- The original mod’s
effects/tools.jsonomitted#minecraft:pickaxes, so pickaxes weren’t recognized as tools. This mod adds a directstack.is(ItemTags.PICKAXES)check against the vanilla tag to fix that. - The original
ItemSwingEffect#tickhard-coded the main hand (getItemInHand(MAIN_HAND)), so off-hand swings couldn’t fetch the off-hand weapon and produced no sword hum. This mod uses@ModifyVariableto instead fetch the item viaentity.swingingArm(main-hand behavior unchanged).
Features
- Fixes tool/weapon switch sounds and sword hum for mods like Tinkers’ Construct 3
- Mixin-based patching
- Zero impact on vanilla item behavior
- Compatible with data/resource packs: add tags like
#minecraft:swordsto extend classification - Client-side only (
clientSideOnly)
Dependencies
| Dependency | Required | Notes |
|---|---|---|
| Dynamic Surroundings (Expanded) 1.20.1 | Required | The mod being patched |
| Architectury API 9.2.14+ | Required | Dependency of Dynamic Surroundings |
| Tinkers’ Construct 3 + Mantle | Optional (for testing) | The target scenario this mod fixes; not required |
常见问题
Dynamic Surroundings (Expanded) Mixins 支持哪些 Minecraft 版本?
Dynamic Surroundings (Expanded) Mixins 支持 Minecraft Java 版 1.20.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
Dynamic Surroundings (Expanded) Mixins 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
animator70 的其他作品
查看全部 →Item! Prohibited use of items.
By configuring, players are unable to use items; This mod will not delete items, it only prevents players from using them while holding them, but allows them to hold disabled items for workbench interaction, etc.
Rlcombat hits
A lightweight mod that adds extra hit and crit sound effects to Minecraft melee attacks, just like in RLCombat. You'll hear a slash sound when your weapon connects and a sharp crack on a critical hit.
Dragon Blessings
Provide players with three "Dragon Blessing" attack methods: the attack method is independent of the item: holding the corresponding blessing effect (buff), attacking the target will trigger the corresponding dragon attack effect.
评论
登录后评论和评分