跳到正文

KubeJS Rechiseled

作者:Wiley

Rechiseled integration for KubeJS

收藏

介绍

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

KubeJS Rechiseled

Rechiseled integration for KubeJS.

KubeJS Rechiseled adds a dedicated scripting event for creating and modifying Rechiseled chiseling sets through KubeJS.

Instead of generating datapack files or manually overriding JSON resources, chiseling sets can be managed directly from readable JavaScript files inside your kubejs/server_scripts folder.

Usage

Register and modify chiseling sets with the RechiseledEvents.chiseling event:

RechiseledEvents.chiseling(event => {
    // Chiseling sets go here
})

Adding a Chiseling Set

Use event.add() to register a new chiseling set.

RechiseledEvents.chiseling(event => {
    event.add('andesite_set', [
        'minecraft:andesite',
        'minecraft:polished_andesite',
        '#minecraft:stone_tool_materials'
    ])
})

The first argument is the identifier for the new chiseling set.

The second argument is an array containing the blocks or tags that should be included in the set.

Both individual block IDs and block tags are supported.

Overwriting a Chiseling Set

Use event.overwrite() to replace the contents of an existing chiseling set.

RechiseledEvents.chiseling(event => {
    event.overwrite('custom_stone_set', [
        'minecraft:stone',
        'minecraft:smooth_stone'
    ])
})

This replaces the existing entries in the specified chiseling set with the entries supplied by the script.

Complete Example

RechiseledEvents.chiseling(event => {
    event.add('andesite_set', [
        'minecraft:andesite',
        'minecraft:polished_andesite',
        '#minecraft:stone_tool_materials'
    ])

    event.overwrite('custom_stone_set', [
        'minecraft:stone',
        'minecraft:smooth_stone'
    ])
})

Dynamic Set Generation

Because chiseling sets are defined through JavaScript, larger collections can be generated using arrays and loops.

const colors = [
    'red',
    'blue',
    'green',
    'yellow'
]

RechiseledEvents.chiseling(event => {
    const entries = [
        'examplemod:metal_panel'
    ]



    colors.forEach(color => {
        entries.push(`examplemod:${color}_metal_panel`)
    })

    event.add('colored_metal_panels', entries)
})

This makes it easy to create large chiseling sets without manually listing every block in multiple JSON files.

Requirements

bisect

常见问题

KubeJS Rechiseled 支持哪些 Minecraft 版本?

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

KubeJS Rechiseled 怎么安装?

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

评论

登录后评论和评分

Wiley 的其他作品

查看全部 →