Solved Grab entity that was spawned?

Discussion in 'Spigot Plugin Development' started by GnRDevelopment, Jul 22, 2018.

  1. Hi, is there a way to get an entity that was spawned and see what it was spawned with. Say if I had a normal creeper egg and I wanted to make it supercharged without smiting it. Am I able to turn it into a supercharged without getting rid of it and spawning a new one?

  2. Hi

    You can catch the player who is using the spawn egg, the itemstack and the location in the PlayerInteractEvent and cache it. Then you listen for the CreatueSpawnEvent and check if the location equals a cached one. If it's equal you can get the entity from the CreatureSpawnEvent and there you go. In your case, you cast it to a creeper and set it to powered.
  3. I'll take a look, thank you.

    Thanks, I'll use this info and go from there
  4. Mark the thread as solved if you already have the answers you need : )