diff --git a/animations/armor_stand.animation.json b/animations/armor_stand.animation.json index c716169..9a6503c 100644 --- a/animations/armor_stand.animation.json +++ b/animations/armor_stand.animation.json @@ -35,6 +35,14 @@ "((math.mod(q.hurt_direction, 100) + math.mod(math.floor(q.hurt_direction / 1000000), 2) * 100)) * (q.is_stalking > 0 ? -1 : 1)"] } } + }, + "animation.armor_stand.geyser_scale": { + "loop": true, + "bones": { + "head":{ + "scale": "v.head_scale" + } + } } } } diff --git a/developer_documentation.md b/developer_documentation.md index ce39087..fe68843 100644 --- a/developer_documentation.md +++ b/developer_documentation.md @@ -57,6 +57,12 @@ Bedrock armor is defined via attachables, which contain geometry that utilize th Above, `query.owner_identifier` returns the identifier of the entity to which the attachable is applied, and thus this attachable will only be applied when the owner identifier is `minecraft:armor_stand`. +Geyser scales down small armor stands to 0.5. However, this has the unintended side effect of making the head slot appear smaller than it does on Java Edition. Consequently, the query `q.is_baby` is applied when an armor stand is small, which is then used to trigger an animation which upscales the head slot by 1.3984. This value was derived from the [attached chart](https://cdn.discordapp.com/attachments/338267383904993291/417695114249371648/unknown.png) linked in the Blockbench Discord. Since large armor stand head slots have a scale of 0.625 to one block, downscaling by half gives a scale of 0.3125 to one block. The proper scale, per the chart, is 0.437. Thus, the slot must be upscaled by 1.3984 to compensate, which is derived by dividing 0.437 by 0.3125. Behavior pack scale is not applied to heads, pumpkins, and banners, which do render in the head slot in vanilla Bedrock. Because the downscaling is not applied to these, a Molang expression is used to set the scale to use. When a head or carved pumpkin is placed in the head slot, the scaling is done at half of 1.3984 to account for the fact that the initial downscaling was never applied. Banner scaling for small armor stands cannot be fixed at this time due to their attachment occurring above the root bone of the model, as they must use the chestplate slot on Bedrock. + +```c +v.head_scale = q.is_item_name_any('slot.armor.head', 0, 'minecraft:skull', 'minecraft:carved_pumpkin') ? 0.6992 : 1.3984; +``` + ### Iron golems #### Cracking diff --git a/entity/armor_stand.entity.json b/entity/armor_stand.entity.json index 144ed9a..abefa36 100755 --- a/entity/armor_stand.entity.json +++ b/entity/armor_stand.entity.json @@ -27,17 +27,20 @@ "wiggle": "animation.armor_stand.wiggle", "controller.pose": "controller.animation.armor_stand.pose", "controller.wiggling": "controller.animation.armor_stand.wiggle", - "geyser_pose": "animation.armor_stand.geyser_pose" + "geyser_pose": "animation.armor_stand.geyser_pose", + "geyser_scale": "animation.armor_stand.geyser_scale" }, "scripts": { "initialize": [ "v.armor_stand.pose_index = 0;", - "v.armor_stand.hurt_time = 0;" + "v.armor_stand.hurt_time = 0;", + "v.head_scale = q.is_item_name_any('slot.armor.head', 0, 'minecraft:skull', 'minecraft:carved_pumpkin') ? 0.6992 : 1.3984;" ], "animate": [ {"controller.pose": "!q.is_bribed"}, {"controller.wiggling": "!q.is_bribed"}, - {"geyser_pose": "q.is_bribed"} + {"geyser_pose": "q.is_bribed"}, + {"geyser_scale": "q.is_baby"} ] }, "geometry": { diff --git a/manifest.json b/manifest.json index a853b21..d5823df 100755 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "description": "Optional Bedrock resource pack to extend Geyser functionality", "name": "GeyserOptionalPack", "uuid": "e5f5c938-a701-11eb-b2a3-047d7bb283ba", - "version": [1, 0, 4], + "version": [1, 0, 5], "min_engine_version": [ 1, 16, 0 ] }, "modules": [ @@ -12,7 +12,7 @@ "description": "GeyserOptionalPack", "type": "resources", "uuid": "eebb4ea8-a701-11eb-95ba-047d7bb283ba", - "version": [1, 0, 4] + "version": [1, 0, 5] } ] }