Carry Mechanics (0.0.0-beta.44)
Curse Maven Snippet
What's new
v0.0.0-beta.44 — Carried block held with both arms, matching Carry On's look
Fix
- Block no longer anchored to a single hand: the previous attempt anchored the carried block to the right hand bone, which still looked like holding an item in one hand instead of carrying it with both arms in front of the chest. Ported the actual positioning logic from the reference mod (Carry On): the block is now placed with a fixed transform relative to the player's torso — scaled down, pulled in front of the body and slightly down — so it looks embraced with both arms and stays stable at any camera angle instead of following arm-swing animation.
- First person now shows the block instead of your own hands: instead of drawing the block alongside the vanilla hand render, the mod now cancels the hand render entirely via NeoForge's
RenderHandEventwhile carrying a block and draws the carried block in its place — the same technique Carry On uses, giving the "both hands carrying it" look instead of one hand awkwardly holding it.
Technical Changes
CarryRenderHelper(new) — ported torso-relative transform math (scale/translate/rotate) from Carry On's positioning code, adapted to this mod'sCarryData/ModelOverrideHandler.CarriedObjectRender(new) — resolves the carried block as anItemStackviaItemModelResolver.updateForTopItem(..., ItemDisplayContext.NONE, ...)and submits it through the transform above, shared by both first- and third-person call sites.ClientEvents— added aRenderHandEventlistener that cancels vanilla hand rendering and draws the carried block instead, on the main-hand pass only.CarryingItemRenderLayer— now delegates straight toCarriedObjectRender.draw(...)instead of anchoring to the hand bone viatranslateToHand.ICarryOnRenderState/PlayerRenderStateMixin/AvatarExtractorMixin— the render state now also caches a reference to thePlayerentity being rendered, needed by the shared draw call.- Removed
ItemInHandRendererMixinandCarriedBlockRenderer(superseded by the event-based approach above).
This mod has no additional files