FmmAttachableGenerator

Generates Bedrock attachable definitions for FMM bone models, mirroring Rainbow's BedrockAttachableContext geometry path 1:1. Emits: - materials.default = entity_emissive_alpha (stock Bedrock material, alpha cutout + alpha-proportional emissive). Opaque pixels still sample world light, so models render dark when the entity origin lands inside a solid block — see "Known limitation: Bedrock dark-in-shadow" below for the full story. - animations.first_person / third_person / head referencing the three animations produced by FmmAnimationGenerator. - scripts.animate with three context-conditional entries (no pre_animation indirection; matches BedrockAttachableContext.java:68-75).

Known limitation: Bedrock dark-in-shadow

Bedrock samples world-light at the entity origin (unlike Java, which samples at rendered geometry). FMM's packet armor stands often sit with their origin ~1.438 blocks below the visible model — frequently inside the ground — so world_light reads 0 and the bone renders pitch black on Bedrock clients.

Three fixes were attempted and rejected in May 2026:

  1. Custom .material file (rspm_unlit:entity_emissive_alpha with USE_ONLY_EMISSIVE). Bedrock 1.16.100+ broke material inheritance from vanilla materials; the client emits a flood of content-log errors and the pack fails to load.
  2. Per-viewer entity Y-lift (FMM-side) + pack-side compensation (geometry pivot offset OR head-animation translation). Both pack-side compensations create an offset between the cube and its rotation centre (the armor stand head bone pivot), so head_pose rotations swing the bone in an arc instead of rotating it in place. Geometrically impossible to fix without abandoning either lighting or rotation.
  3. Material swap to entity_emissive (alpha = emissive intensity, .tga texture). Gives fullbright but eliminates the alpha channel needed for transparency. entity_emissive_layer would give both but isn't valid for attachables (not in the attachable schema).

There is no vanilla-supported Bedrock material that provides both transparency AND opaque-pixel-fullbright for attachables. The limitation is accepted: place FMM models in well-lit areas, or accept dark rendering when the entity origin is buried.

Constructors

Link copied to clipboard
public void FmmAttachableGenerator()

Functions

Link copied to clipboard
public static String generate(String modelName, String boneName, String geometryId, String bedrockTexturePath, JsonObject javaModel, File bedrockPackDir)
Generates an attachable JSON file and its companion three-pose animation file for one bone.
Link copied to clipboard
public static FmmAnimationGenerator.AnimationIds prepareAnimations(String animBaseId, String animFileBase, JsonObject javaModel, File bedrockPackDir)
Phase G — Step 1 of 2 for the generic pipeline.
Link copied to clipboard
public static String writeAttachable(String bedrockIdentifier, String attachableOutputPath, String geometryId, String bedrockTexturePath, FmmAnimationGenerator.AnimationIds animIds, File bedrockPackDir)
Phase G — Step 2 of 2 for the generic pipeline.
public static String writeAttachable(String bedrockIdentifier, String attachableOutputPath, String geometryId, String bedrockTexturePath, FmmAnimationGenerator.AnimationIds animIds, ItemParticleAttachment particles, File bedrockPackDir)
As writeAttachable, also wiring held-item particles when particles is not null.