Spawn an entity from a local variable

Started by Aftasardem on

Topic category: Feature requests and ideas for MCreator

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Spawn an entity from a local variable

I believe this is both a simple request and a useful one.

People who have ever used MCreator to do more complex stuff with entities have likely run into the problem of assigning properties/variables to an entity that's not been spawned yet or just did. For which, most people seem to use this very simple workaround:

a loop for each entity in the spawn position

 

However, it would be not only more convenient, but possibly more performant and also more on par with how it's actually written in most engines to do any action you want to a local variable and then spawning this instance into the world. Like such:saving an entity as a variable before instantiating the variable itself

In this badly edited example, the entity variable is first created as a cow, given a potion effect and then instantiated into the world with a spawn function! :D

 

I've seen a handful of posts talking about this, but it seems to either be too niche of a request or the people who really feel like using this method just script it by themselves. (or there's already something like this somewhere within MCreator that I'm just too dumb to find, which would have all funnies)