跳到正文

Unified API

作者:Rebel459

A comprehensive data-driven multiloader modding api built for both modders and data-packers

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

About

Unified API is a cross-loader API for both Fabric & NeoForge that enables you to create multiloader mods at no additional effort.

It is also a data-focused library that provides powerful new features to datapacks and resource packs, including data-driven blocks, items, entity variants and much more.

Additionally, this library is an advanced data generator for modders, with unified registration generators that put all your block, item and entity code in the one place.

The goal of this project is to provide an up-to-date, efficient & flexible way of creating modded content at a much faster pace than what is typically afforded both by competing multiloader projects and the official loaders themselves.

_To prove the true extent of these features, you’ll need to visit the Unified API Documentation._

Feature Highlights

All-in-one registration generation.

Register your content in one place. All behaviour is handled by vanilla and Unified API-specific JSON, generated from this code. JSON can then be overriden by users or other projects for full customisability.

public static final SuppliedItem EXAMPLE_ITEM = ITEMS.register(
        "example_item",
        VanillaItemCodecs.ITEM.create(),
        builder -> builder
                .properties(properties -> properties
                        .stacksTo(16)
                        .rarity(Rarity.UNCOMMON)
                )
                .assets(assets -> assets
                        .handheld()
                )
                .data(data -> data
                        .dropSelf()
                )
);

Data-driven Registries

Blocks, Items, Entities, Creative Tabs, Sound Events and more can all be created via JSON.

{
  "type": "minecraft:block",
  "properties": {
     // properties go here
  }
}

Traditional Multiloader Deferring

In a multiloader environment, your content needs to be deferred. UnifiedRegistries coupled with Supplied<Object> handles this much like other multiloader projects, with some convenient bonuses.

Extensive Events & Helpers

Modify biome attributes or features, change default components, inject loot tables or alter individual entries, create mob variants and much more – supported via both code-driven events and data-driven listeners.

Furthermore, there is a full networking api, data attachments, structure-specific music and anything else you’d expect to need when making complex mods.

Instantly create entire sets

Common, tedious-to-create content like woodsets, brick sets, colored sets, equipment sets and more can be generated as JSON in an instant, with all functionality you’d normally spend a while creating manually. Cutting down on meaningless busywork was a major motivator in creating Unified API over using options already out there.

An Absurd Amount More

The goal of Unified API is to drastically reduce the time it takes to add modded content, whilst additionally exposing many new features to non-modders. You do not need to use another api alongside this one, and migration from your existing systems should be relatively simple considering the inclusion of more traditional registries alongside new, more agile features.

_Once again, be sure to check out unified-api.dev for documentation and the full feature set!_

常见问题

Unified API 支持哪些 Minecraft 版本?

Unified API 支持 Minecraft Java 版 1.21.11–26.3,共 6 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。

Unified API 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。

评论

登录后评论和评分

Rebel459 的其他作品

查看全部 →