Animated-Java / animated-java

A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition.
Other
156 stars 25 forks source link

[BUG] `animated_java:<model>/remove/this` error message has hard-coded tag #208

Closed TheAfroOfDoom closed 2 months ago

TheAfroOfDoom commented 2 months ago

Describe the bug

When you incorrectly try to run a function animated_java:<model>/remove/this as an entity other than the model's corresponding root entity, the error printed can display the wrong tag if you have multiple models.

To Reproduce

Steps to reproduce the behavior:

  1. Export multiple blueprints (e.g. model_1 and model_2)
  2. Run function animated_java:model_2/remove/this
  3. See wrong tag printed (e.g. You can use ... tag=aj.model_1.root instead of model_2)

Expected behavior

The printed tag should match the model.

Error Message

N.A

Screenshots

N/A

Desktop (please complete the following information):

Additional context

You can see the outputted AJ functions have a hard-coded tag in the error message at the end:

datapacks/animated_java/data/animated_java/function/global/errors/function_not_executed_as_root_entity.mcfunction

# This file was generated by Animated Java via MC-Build. It is not recommended to edit this file directly.
$tellraw @a ["",[{"text":"[","color":"gray"},{"text":"AJ","color":"aqua"},{"text":"] "}],{"text":"Error: ","color":"red"},{"text":"The function ","color":"red"},{"text":"$(function_path)","color":"yellow"},{"text":" must be executed as the root entity.","color":"red"},{"text":"\n You can use ","color":"red"},{"text":"execute as @e[tag=aj.soul_0_bandaid.root] run ...","color":"aqua"},{"text":" to run the function as the root.","color":"red"}]