From 800a9077add1c4e2c3660a05a1e0594bc1ccca25 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Tue, 14 Oct 2025 17:17:17 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Fix=20display=20entity=20con?= =?UTF-8?q?fig=20not=20respecting=20on-summon=20and=20on-apply=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapackCompiler/1.20.4/animation.mcb | 16 ++++++++++++++++ src/systems/datapackCompiler/1.20.4/static.mcb | 16 ++++++++++++++++ .../datapackCompiler/1.20.5/animation.mcb | 16 ++++++++++++++++ src/systems/datapackCompiler/1.20.5/static.mcb | 16 ++++++++++++++++ .../datapackCompiler/1.21.2/animation.mcb | 16 ++++++++++++++++ src/systems/datapackCompiler/1.21.2/static.mcb | 16 ++++++++++++++++ .../datapackCompiler/1.21.4/animation.mcb | 16 ++++++++++++++++ src/systems/datapackCompiler/1.21.4/static.mcb | 16 ++++++++++++++++ src/systems/rigRenderer.ts | 15 ++++++++++----- .../blueprints/armor_stand_1.20.4.ajblueprint | 4 ++-- 10 files changed, 140 insertions(+), 7 deletions(-) diff --git a/src/systems/datapackCompiler/1.20.4/animation.mcb b/src/systems/datapackCompiler/1.20.4/animation.mcb index ee70d9e7..29571561 100644 --- a/src/systems/datapackCompiler/1.20.4/animation.mcb +++ b/src/systems/datapackCompiler/1.20.4/animation.mcb @@ -695,6 +695,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -989,6 +999,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -1006,6 +1017,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.20.4/static.mcb b/src/systems/datapackCompiler/1.20.4/static.mcb index c77f2767..a767e11d 100644 --- a/src/systems/datapackCompiler/1.20.4/static.mcb +++ b/src/systems/datapackCompiler/1.20.4/static.mcb @@ -276,6 +276,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -570,6 +580,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -587,6 +598,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.20.5/animation.mcb b/src/systems/datapackCompiler/1.20.5/animation.mcb index ba5dbaac..0de787e0 100644 --- a/src/systems/datapackCompiler/1.20.5/animation.mcb +++ b/src/systems/datapackCompiler/1.20.5/animation.mcb @@ -695,6 +695,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -989,6 +999,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -1006,6 +1017,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.20.5/static.mcb b/src/systems/datapackCompiler/1.20.5/static.mcb index 3fb33900..291df560 100644 --- a/src/systems/datapackCompiler/1.20.5/static.mcb +++ b/src/systems/datapackCompiler/1.20.5/static.mcb @@ -276,6 +276,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -570,6 +580,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -587,6 +598,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.21.2/animation.mcb b/src/systems/datapackCompiler/1.21.2/animation.mcb index 65e8ee77..9b7a1793 100644 --- a/src/systems/datapackCompiler/1.21.2/animation.mcb +++ b/src/systems/datapackCompiler/1.21.2/animation.mcb @@ -695,6 +695,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -989,6 +999,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -1006,6 +1017,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.21.2/static.mcb b/src/systems/datapackCompiler/1.21.2/static.mcb index 67903177..74521ad7 100644 --- a/src/systems/datapackCompiler/1.21.2/static.mcb +++ b/src/systems/datapackCompiler/1.21.2/static.mcb @@ -276,6 +276,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -570,6 +580,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -587,6 +598,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.21.4/animation.mcb b/src/systems/datapackCompiler/1.21.4/animation.mcb index f30d83d0..862a438b 100644 --- a/src/systems/datapackCompiler/1.21.4/animation.mcb +++ b/src/systems/datapackCompiler/1.21.4/animation.mcb @@ -695,6 +695,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -989,6 +999,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -1006,6 +1017,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/datapackCompiler/1.21.4/static.mcb b/src/systems/datapackCompiler/1.21.4/static.mcb index 37de5f68..1015b9e0 100644 --- a/src/systems/datapackCompiler/1.21.4/static.mcb +++ b/src/systems/datapackCompiler/1.21.4/static.mcb @@ -276,6 +276,16 @@ function summon { } } + REPEAT (Object.values(rig.nodes).filter(node => BONE_TYPES.includes(node.type) && node.on_summon_function?.trim())) as node { + execute \ + on passengers if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + run block node_on_summon_<%node.storage_name%> { + <%% + emit.mcb(node.on_summon_function.trim()) + %%> + } + } + IF (on_summon_function) { execute at @s run block rig_on_summon { <%% @@ -570,6 +580,7 @@ IF (Object.keys(rig.variants).length > 1) { execute \ on passengers \ if entity @s[tag=<%TAGS.PROJECT_NODE_NAMED(export_namespace, node.storage_name)%>] \ + at @s \ run \ block zzz/apply_to_node_<%node.storage_name%> { IF (node.type === 'bone' && variant.models[node.uuid] !== undefined) { @@ -587,6 +598,11 @@ IF (Object.keys(rig.variants).length > 1) { IF (!global.config.isDefault()) { data merge entity @s <%global.config.toNBT(undefined, variant.is_default)%> } + IF (global.config.onApplyFunction) { + <%% + emit.mcb(global.config.onApplyFunction) + %%> + } } } } diff --git a/src/systems/rigRenderer.ts b/src/systems/rigRenderer.ts index ebd12d1e..389907fd 100644 --- a/src/systems/rigRenderer.ts +++ b/src/systems/rigRenderer.ts @@ -85,6 +85,7 @@ export interface IRenderedDisplayEntityNode extends IRenderedNode { */ base_scale: number bounding_box: THREE.Box3 + on_summon_function?: string configs?: IDisplayEntityConfigs } @@ -354,7 +355,8 @@ function renderGroup( parent: parentId, bounding_box: getNodeBoundingBox(group), base_scale: 1, - configs: group.configs, + configs: structuredClone(group.configs), + on_summon_function: group.onSummonFunction?.trim(), // This is a placeholder value that will be updated later once the animation renderer is run. default_transform: {} as INodeTransform, } @@ -464,7 +466,8 @@ function renderItemDisplay(display: VanillaItemDisplay, rig: IRenderedRig) { item: display.item, item_display: display.itemDisplay, base_scale: 1, - configs: display.configs, + configs: structuredClone(display.configs), + on_summon_function: display.onSummonFunction?.trim(), bounding_box: getNodeBoundingBox(display), default_transform: {} as INodeTransform, } @@ -492,7 +495,8 @@ function renderBlockDisplay(display: VanillaBlockDisplay, rig: IRenderedRig) { block: display.block, parent: parentId, base_scale: 1, - configs: display.configs, + configs: structuredClone(display.configs), + on_summon_function: display.onSummonFunction?.trim(), bounding_box: getNodeBoundingBox(display), default_transform: {} as INodeTransform, } @@ -527,7 +531,8 @@ function renderTextDisplay(display: TextDisplay, rig: IRenderedRig): INodeStruct shadow: display.shadow, see_through: display.seeThrough, base_scale: 1, - configs: display.configs, + configs: structuredClone(display.configs), + on_summon_function: display.onSummonFunction?.trim(), bounding_box: getNodeBoundingBox(display), default_transform: {} as INodeTransform, } @@ -549,7 +554,7 @@ function renderLocator(locator: Locator, rig: IRenderedRig) { storage_name: sanitizeStorageKey(locator.name), uuid: locator.uuid, parent: parentId, - config: locator.config, + config: structuredClone(locator.config), max_distance: 0, default_transform: {} as INodeTransform, } diff --git a/test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint b/test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint index 8b01582e..c978b1d9 100644 --- a/test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint +++ b/test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint @@ -928,7 +928,7 @@ "export": true, "item": "minecraft:diamond", "itemDisplay": "none", - "onSummonFunction": "", + "onSummonFunction": "say I'm a Diamond!", "configs": { "default": { "on_apply_function": "", @@ -945,7 +945,7 @@ }, "variants": { "49521f4b-b970-e4bd-b594-2e05d2d46027": { - "on_apply_function": "", + "on_apply_function": "say I'm now a very colorful diamond!", "billboard": "fixed", "override_brightness": false, "brightness_override": 0, From ec7a8bc55c2edada6be79447e1f745b49e1434a9 Mon Sep 17 00:00:00 2001 From: SnaveSutit Date: Tue, 14 Oct 2025 17:19:45 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=96=20v1.8.0-beta.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/pluginPackage/changelog.json | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e4aa4f70..3804d9c2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "title": "Animated Java", "icon": "icon.svg", "description": "Effortlessly craft complex animations for Minecraft: Java Edition", - "version": "1.8.0-beta.2", + "version": "1.8.0-beta.3", "min_blockbench_version": "4.12.0", "max_blockbench_version": "4.12.6", "variant": "desktop", diff --git a/src/pluginPackage/changelog.json b/src/pluginPackage/changelog.json index c953714f..ebfe2df2 100644 --- a/src/pluginPackage/changelog.json +++ b/src/pluginPackage/changelog.json @@ -379,5 +379,16 @@ ] } ] + }, + "1.8.0-beta.3": { + "title": "v1.8.0-beta.3", + "author": "Titus Evans (SnaveSutit)", + "date": "2025-10-15", + "categories": [ + { + "title": "Fixes", + "list": ["Fixed On-Summon Functions and On-Apply Functions not functioning."] + } + ] } }