Simple NPC

数据包

· 作者 WindWaves_Sea

此数据包简化了配置原版风格 NPC 的流程;您只需定义存储并执行生成函数,即可设置自己的 NPC。

0 本站下载 0 关注 更新于 2 个月前

最新 V1.1.0 · 26.2 · 数据包

一键开服(送7天)

English 简体中文

简介

本数据包让在原版 Minecraft 中配置 NPC 变得更加简单。只需将所需数据写入存储区,然后执行召唤功能即可创建你自己的 NPC。

特性

支持以下特性:

  • 在 NPC 上方显示自定义浮动文本。
  • 自定义 NPC 皮肤。
  • 当右键点击 NPC 时执行命令或函数。

存储结构

默认结构(禁用自定义设置)

Default Structure (Custom Settings Disabled)

自定义结构(启用自定义设置)

Custom Structure (Custom Settings Enabled)

示例存储

默认配置

data modify storage windwaves_sea:npc root.npc_setting merge value {\
    test:{\
        name:"test",\
        zone:"test",\
        config:{\
            custom_settings:false,\
            look_player:true\
        },\
        text:{\
            pos:{x:1,y:1,z:1},\
            text:[{text:"1"}]\
        },\
        npc:{\
            pos:{x:1,y:1,z:1},\
            model:"wide",\
            texture:"lobby:npc/start_game",\
            rotation:[180,0]\
        },\
        right_click:{\
            command:"",\(function:""\)
        }\
    }\
}

自定义配置

data modify storage windwaves_sea:npc root.npc_setting merge value {\
    test_custom:{\
        name:"test_custom",\
        zone:"test",\
        config:{\
            custom_settings:true,\
            look_player:true,\
            default_orientation:"north" \
        },\
        text:{\
            pos:{x:1,y:1,z:1},\
            data:{}\
        },\
        npc:{\
            pos:{x:1,y:1,z:1},\
            data:{}\
        },\
        right_click:{\
            function:""\(command:""\)
        }\
    }\
}

命令参考

召唤 NPC

function npc:summon {name:"name"}

召唤一个 NPC。运行此函数前必须先将配置写入存储区。无法生成重复的 NPC。name 指的是上述配置中定义的 NPC 名称(以下同理)。

移除 NPC

function npc:remove/npc {name:"name"}

移除配置(同时移除 NPC)

function npc:remove/setting {name:"name"}

下载

QQ 群:117464315

GitHub:

致谢

特别感谢 NOX OBSCURA 提供的交互实体尺寸解决方案,使交互实体能够正确匹配 NPC 的碰撞箱。

特别感谢 轩宇1725 提供的存储区检测方案,实现了基于字符串的检测。

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源