[Solved] EntitySpawnCause Gone in 7.1.0?

Hello, I’m trying to update an old plugin that ran in 5.0, but I noticed that EntitySpawnCause is no longer in the 7.1.0 API. Is there a way to see what aspects of the Sponge API are changed during the version updates or a way to know how to update your code? Thanks!

Api 5.0 has gone for a while meaning that there are 2 major api changes since then.

The way I would suggest is sticking the original code in a IDE with sponge API 7 and see what errors pop up (you may need to click “refresh” on eclipse or “rebuild” on Intelijj). After you see what errors pop up. Go to the sponge docs and research what you can about the line of code that has gone wrong. Failing that go to the github sponge docs and figure it out there.

As for EntitySpawnCause, most “causes” were removed after API 6 for the CauseTracker API so to spawn an entity now you just need to do the following at minimum.

World world;
double x;
double y;
double z;
EntityType type;
Entity entity = world.createEntity(type, x, y, z);
world.spawnEntity(entity);
1 Like

You can add your 2¢ here. Migration Guide between API versions? - #5 by gabizou