Mineuniverse
Mods
Spawn Egg BYID Redirect

Spawn Egg BYID Redirect

MOD
Needed for same Spawn Egg type compatibility
by Jackbusters
Download Claim this project
1,827 downloads
0 likes
Updated Oct 14, 2026
0 hypes
API and Library Mobs
Advertisement Remove ads with Premium →

For Users:

Some mods may rely on things this mod does in the background to function properly. Just install it alongside any mod that requires it on both client and server.

Use Case: If a mod you have installed adds multiple spawn eggs for the same type of mob (i.e. for different variants), and one of the spawn eggs lost its color as a result, this mod may fix the color. 

 

Mods which rely on this:

 

For Developers:

The following steps are irrelavent for Forge/NeoForge. Just use ForgeSpawnEggItem.

This mod makes BY_ID#put() inside of the SpawnEggItem constructor call BY_ID#putIfAbsent() instead. While this change may seem minor, it makes a big difference when you want to have multiple spawn eggs with the same entity type (For instance, if you want spawn eggs which spawn variants).

 

A short tutorial on how to go about using this mod when adding something like a variant spawn egg:

1) Create a new class extending SpawnEggItem (Mojang Official Mappings, extend whatever this is converted to the mappings of your choice).

2) Create a public static ArrayList of type SpawnEggItem inside the class you created like so:

public static final ArrayList<SpawnEggItem> EGGS = new ArrayList<>();

3) In your constructor, add the current instance to the ArrayList you created like so:

super(entityType, i, j, properties);
[...]
EGGS.add(this);

4) Inside your ClientModInitializer, register the colors to your spawn eggs like so:

@Override
public void onInitializeClient() {
    WolfVariantEgg.EGGS.forEach((egg) -> 
            ColorProviderRegistry.ITEM.register((stack, tintIndex) 
                    -> egg.getColor(tintIndex), egg));
}

5) If you run the mod now you'll notice that your general spawn egg, not specified to a variant, will have lost its color. That's what this mod fixes without any extra work on your part so long as you didn't do anything to the BY_ID map.

Most other work will probably be done by overriding the useOn method of SpawnEggItem. I won't be walking you through that one since it doesn't really pertain to this mod, but let me know if you run into any issues and I may try to help.

 

Modpack Policy:

 You are free to include this mod in any Modpack hosted on CurseForge.

 

Server Hosting Discount

Follow the link below and use code "JACKBUSTERS" at checkout for 25% off server hosting.

[Fabric 1.19.x - 1.21] SEBR v1.2
MC 1.19.3, 1.20.2, 1.21, 1.19.4-Snapshot, 1.20.5, 1.20.2-Snapshot, 1.20.5-Snapshot, 1.19.4, Fabric, 1.19-Snapshot, Client, 1.19.2, 1.20.3-Snapshot, 1.20.3, 1.20.1, 1.20, 1.20.6
Release 2024-07-19 Get
[Fabric 1.15.x - 1.18.x] SEBR v1.1
MC 1.16-Snapshot, 1.17.1, 1.16.3, 1.16.1, 1.18.1, 1.17, 1.15, 1.16, Fabric, Client, 1.16.5, 1.18.2, 1.15.2, 1.17-Snapshot, 1.18, 1.16.4, Server, 1.18-Snapshot, 1.16.2, Quilt
Release 2024-05-21 Get
[Fabric 1.19.x - 1.20.x] SEBR v1.1
MC 1.19.3, 1.20.2, 1.19.4-Snapshot, 1.20.5, 1.20.2-Snapshot, 1.20.5-Snapshot, 1.19.4, Fabric, Client, 1.19.2, 1.20.3-Snapshot, 1.20.3, 1.20.1, 1.20, 1.20.6, 1.19.1, 1.20.4
Release 2024-05-21 Get
[Forge 1.20.x] SEBR v1.0
MC Client, Forge, 1.20.6, Server
Release 2024-05-12 Get
[Fabric 1.20.x] SEBR v1.0
MC 1.20.2, 1.20.5, 1.20.2-Snapshot, 1.20.5-Snapshot, Fabric, Client, 1.20.3-Snapshot, 1.20.3, 1.20.1, 1.20, 1.20.6, 1.20.4, 1.20-Snapshot, Server, Quilt
Release 2024-03-10 Get

More from Jackbusters

Advertisement Remove ads with Premium →

You Might Also Like