[SPIGOT-1592] SpawnEgg#getSpawnedType always returns null Created: 01/Mar/16  Updated: 06/Dec/16  Resolved: 06/Dec/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: LEGOlord 208 Assignee: Unassigned
Resolution: Fixed Votes: 21
Labels: 1.9, bug, egg, spawning, spigot
Environment:

Windows 10
Spigot git-Spigot-604e046-69e196f (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)



 Description   

SpawnEgg#getSpawnedType always returns null.
Previously they would return the entity a SpawnEgg would spawn.



 Comments   
Comment by orgin_org [ 21/Sep/16 ]

Any news on this?

Comment by tastybento [ 10/Jul/16 ]

I could really do with this. Is the pull request okay?

Comment by Sebastian Binder [ 31/Mar/16 ]

Is there any update on this or furthermore what's the status of the PR?

Comment by Matthew Steglinski [ 15/Mar/16 ]

A PR has already been submitted and is under review: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/148/overview

Comment by Faris Rehman [ 15/Mar/16 ]

I would have made this myself but I don't want to give personal details etc. for this contribution agreement or w/e.

Comment by Faris Rehman [ 15/Mar/16 ]

Any update on this...

Comment by md_5 [ 08/Mar/16 ]

You have to use ItemMeta when submitting for inclusion in the API, so it's a bit more involved

Comment by tastybento [ 08/Mar/16 ]

Hmm, I wrote a 1.9 version of the class that seems to work okay. I'll submit it as a pull request once I've sorted the legal out. It's GPL 3 anyway.

https://github.com/tastybento/askyblock/blob/3.0.0/src/com/wasteofplastic/askyblock/util/SpawnEgg1_9.java

However, I wrote this mainly to enable itemstack to monster egg conversion and back, and I know nothing about the greater structure of spigot...

Comment by LEGOlord 208 [ 04/Mar/16 ]

If you aren't lazy like me, and instead use reflection it won't break

Comment by orgin_org [ 04/Mar/16 ]

@LEGOlord

Wouldn't that make my plugin break at each update?

Comment by LEGOlord 208 [ 04/Mar/16 ]

Use NBTTags! When i tried some NBTExplorer magic on single player I found it in "EntityTags" compound I believe, and the name "id". For loading you make it uppercase and EntityType.valueOf(). For saving you would use toString() and toLowerCase

Comment by orgin_org [ 04/Mar/16 ]

Hmm, can't release my plugin "HothGenerator" before I can set spawn egg type.

How can I do this at the moment? (code example please)

Comment by LEGOlord 208 [ 02/Mar/16 ]

Then I should be able to use NBT to figure it out?

EDIT: yay did it

Comment by md_5 [ 01/Mar/16 ]

This is hard. Spawn eggs use NBT not data now, which means that these methods need to be moved into an ItemMeta class belonging to SpawnEgg.
I'm gonna deprecate these two methods since there is no way to make them work, but a replacement is yet to be made.

Generated at Sun Mar 30 18:01:22 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.