介绍
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.
Follow the link below and use code “JACKBUSTERS” at checkout for 25% off server hosting.
For Developers:
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.
常见问题
Spawn Egg BYID Redirect 支持哪些 Minecraft 版本?
Spawn Egg BYID Redirect 支持 Minecraft Java 版 1.15–1.21,共 27 个版本,可用的加载器:Fabric / Forge / Quilt。下载时注意选择和你游戏版本一致的文件。
Spawn Egg BYID Redirect 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。
Jackbusters 的其他作品
查看全部 →All Arrows Infinity Fix
让“无限”附魔在 1.12、1.16–26 版本的 (Neo)Forge 和 Fabric 上对所有箭都生效。
Xtra Arrows
一个弓箭扩展模组,添加了大量额外箭矢。支持 (Neo)Forge 和 Fabric。
Wooled Boots
加垫靴子,可消除特定振动,避免被幽匿方块和监守者侦测。
Full Turtle Armor
补全海龟盔甲套装。支持 Forge 和 Fabric。

评论
登录后评论和评分