surface.create_entity_from_item(...)
Posted: Sun Dec 13, 2020 1:19 am
I would like the ability to build/deploy an entity directly from an item, so that if there is entity data saved in the item it would be carried over to the new entity automatically just as though the entity had been built by a player.
Ideally the function would be similar to surface.create_entity except that instead of specifying a name you specify item = LuaItemStack
The entity I'm struggling with is the spidertron as an item. I can't create a spider that properly matches the item because not all values are readable (as far as I can tell), but even if they were the ability to do this in 1 call would be much better than lengthy code trying to replicate the item placement process in lua.
Ideally the function would be similar to surface.create_entity except that instead of specifying a name you specify item = LuaItemStack
The entity I'm struggling with is the spidertron as an item. I can't create a spider that properly matches the item because not all values are readable (as far as I can tell), but even if they were the ability to do this in 1 call would be much better than lengthy code trying to replicate the item placement process in lua.