跳到正文

KubeJS Data Component

作者:RainMelody

KubeJS Data Component is an addon mod for Minecraft 1.21.1 NeoForge

收藏

介绍

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

Mod Overview

KubeJS Data Component is an addon mod for Minecraft 1.21.1 NeoForge that provides comprehensive data component registration capabilities for the KubeJS scripting engine. With this mod, developers can create and register custom data components directly in KubeJS scripts, allowing items to store custom data without writing any Java code.

 

Key Features

🛠️ Easy Registration – Register data components directly in KubeJS scripts

📊 Multiple Data Types – Support for integers, strings, booleans, floats, doubles, and longs

🌐 Network Synchronization – Configurable client-server synchronization

💾 Data Persistence – Support for saving and loading component data

🔧 Highly Customizable – Flexible configuration through builder pattern

 

Example

// Register integer component

DataComponent.registerInt(“my_counter”)

 

// Register string component

DataComponent.registerString(“my_text”)

 

// Custom component with builder

DataComponent.register(“custom_component”, 

    DataComponent.builder()

        .type(“DOUBLE”)

        .persistent(true)

        .networked(true)

)

 

// Using components on items

item.set(DataComponent.get(“my_counter”), 100)

let value = item.get(DataComponent.get(“my_counter”))

 

Technical Features

Built on Minecraft 1.21.1 vanilla data component system

Fully integrated with KubeJS scripting environment

Thread-safe component registration mechanism

Comprehensive error handling and type checking

 

Use Cases

Adding custom counters to items

Storing specific state information for items

Implementing complex item behavior logic

Creating custom progression tracking systems

常见问题

KubeJS Data Component 支持哪些 Minecraft 版本?

KubeJS Data Component 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

KubeJS Data Component 怎么安装?

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

评论

登录后评论和评分

RainMelody 的其他作品

查看全部 →