You implement this by going into your "player.json" file in the entities folder and creating an "on_environment" object that checks if the player as an item in their hand, and then have an event set a component such as "variant", and then in an animation controller have a Molang query check for "is_variant" and "is_using_item" and execute the command from there. However, multiple addons may use the same component, causing compatibility issues because one addon may set a component to a value that another addon recognizes, causing that addon to do something it's not supposed to.
You have to implement it this way because in an animation controller you can't use filters, only Molang queries, and Molang queries can't check for a specific item in an entity's hand. If Molang queries and filters had the same capabilities, this wouldn't be an issue because you wouldn't need to make the "on_environment" object, you could just do it all in the animation controller and there wouldn't be the issue of components being shared across multiple addons.
Please sign in to leave a comment.