Some entities cannot be spawned from variables. #3753
Labels
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
PR available
Issues which have a yet-to-be merged PR resolving it
priority: low
Issues that are not harmful to the experience but are related to useful changes or additions.
Description
Attempting to spawn entities from variables does not work for some entities. Where it does work, failing to prefix the entity's name with "a" causes a failure to set the variable.
Steps to Reproduce
Use this code:
If you use "cow" or "pig" or "zombie" or "creeper" or "wither skull", the code will say "____ is an entity" and then spawn one at your location. However, if you use "chicken" or "armor stand" or "egg" or "arrow" or "snowball" the code will say "____ is not an entity" and then fail to spawn one at your location.
The entities for which this code does work do not work if the word "a" is removed. Without it, the script displays "<none> is not an entity" despite generating no errors when the script is loaded. However, if I set it to something that does not exist in the game, such as "set {_test} to a goat" then with or without the "a" it will generate an error when the script is loaded. Thus it seems to realize that "pig" is a valid thing in the statement "set {_test} to pig" but when the script is run it fails to set {_test} to anything. I don't know if this is a related bug or a separate one.
Expected Behavior
If I can do this...
...then I expect that I should be able to do this...
...and have an identical outcome.
Also, I've come to expect that "a" is an optional word in Skript, so I expect it to be optional in this statement as well, or at least an error should be generated when the script is loaded due to the unrecognized syntax of the statement.
Errors / Screenshots
There are no error messages.
Server Information
Additional Context
This seems similar to #1631.
The text was updated successfully, but these errors were encountered: