Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions src/pluginPackage/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
}
]
}
}
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.20.4/animation.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.20.4/static.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.20.5/animation.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.20.5/static.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.21.2/animation.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.21.2/static.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.21.4/animation.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions src/systems/datapackCompiler/1.21.4/static.mcb
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
<%%
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
%%>
}
}
}
}
Expand Down
15 changes: 10 additions & 5 deletions src/systems/rigRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export interface IRenderedDisplayEntityNode extends IRenderedNode {
*/
base_scale: number
bounding_box: THREE.Box3
on_summon_function?: string
configs?: IDisplayEntityConfigs
}

Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand All @@ -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,
}
Expand Down
4 changes: 2 additions & 2 deletions test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@
"export": true,
"item": "minecraft:diamond",
"itemDisplay": "none",
"onSummonFunction": "",
"onSummonFunction": "say I'm a Diamond!",
"configs": {
"default": {
"on_apply_function": "",
Expand All @@ -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,
Expand Down