Mojira Archive
MCM-1323

Behavior entity scripts initialize before the world is fully loaded

Partner Rank: 3

Partner Team Reporting: Starfish Studios

Verification builds: ver. 1.16.220.02, build 5685695

Summary:
Behavior entity scripts initialize before the world is fully loaded, causing animations and animation controllers to run before the world is fully opened.

Impact:
This causes commands that have selectors not to work if run when the world is loading as soon as the animation is started when executed on player, or when executed on any entity using a player selector.

Repro Steps:

  1. Download and install the attached behavior pack.
  2. Join a world with the behavior enabled.
  3. Open the chat.

Repro Rate: 3/3

Observed Results:
When opening the chat, there's a message saying 'World is still loading'. The command is /say World is still loading, it only worked because '/say' uses no selector. The message is shown above the game message 'Press T or RETURN to open chat' because it was run before the world finished opening, unlike the game message.

Expected Results:
Just like the game message works, this message should only be sent once the world is full opened and another message should be sent, 'Animation has been initialized'. The command is _/tellraw @s {\"rawtext\":[

{\"text\": \"Animation has been initialized\"}

]}_ and it was not sent because '/tellraw' uses a selector, and it was run before the player entity is loaded.

Screenshots/Videos attached: No

Regression Builds: None

Notes:
Codes of the test animation controller:

{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.player.test": {
      "initial_state": "default",
      "states": {
        "default": {
          "on_entry": [
            "/say World is still loading",
            "/tellraw @s {\"rawtext\": [{\"text\": \"Animation has been initialized\"}]}"
          ]
        }
      }
    }
  }
}

This animation controller is always activated in the scripts "animate" array, which should only initialize all of the listed animations as soon as the world is fully loaded.

{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:player",
      "is_spawnable": false,
      "is_summonable": false,
      "is_experimental": false,
      "scripts": {
        "animate": [ "test" ]
      },
      "animations": {
        "test": "controller.animation.player.test"
      }
    },
    ...
  }
}

Unresolved

Jean Lucas

2021-04-01, 06:17 AM

2021-04-05, 11:20 PM

3

1

Future Release

-