Warning: file_put_contents(/www/wwwroot/nmbt.106988770/cache/modrinth_versions_pLwqCiz9.json): Failed to open stream: Permission denied in /www/wwwroot/nmbt.106988770/resource_detail.php on line 53
KubeJS Figura - 墨喵 Minecraft 资源
KubeJS Figura 图标

KubeJS Figura

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.0.7
本资源为搬运资源,原资源地址: https://modrinth.com/mod/kubejs-figura
资源信息

Minecraft 版本: 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6

平台: forge

标签: library utility

资源介绍

A lightweight bridge that exposes core Figura avatar functionality directly to KubeJS scripts. This is designed to add minimal strain to environments and simply provide a safe way to (up)load avatars from server scripts.

For safety, it can only load avatars that already exist in the players avatar folder. This is primarily designed for automatic character systems scripted on the server-side, and allows developers to integrate Figura.

// Example usage of KubeJS Figura in a server script.

const StringArgumentType = Java.loadClass("com.mojang.brigadier.arguments.StringArgumentType");
const ServerPlayer = Java.loadClass("net.minecraft.server.level.ServerPlayer");
const KJSFigura = Java.loadClass("com.confect1on.kubejs_figura.KubeJSFiguraMod");

ServerEvents.commandRegistry(event => {
  const { commands: Commands } = event;

  event.register(
    Commands.literal("figuraLoad")
      .then(

        Commands.argument("model", StringArgumentType.greedyString())
          .executes(ctx => {
            const player = ctx.source.entity;
            const model = StringArgumentType.getString(ctx, "model");

            if (player instanceof ServerPlayer) {
              KJSFigura.load(player, model);
            }

            return 1;
          })
      )
  );

  event.register(
    Commands.literal("figuraUpload")
      .executes(ctx => {
        const player = ctx.source.entity;

        if (player instanceof ServerPlayer) {
          KJSFigura.upload(player);
        }

        return 1;
      })
  );

  event.register(
    Commands.literal("figuraHandle")
      .then(
        Commands.argument("charName", StringArgumentType.greedyString())
          .executes(ctx => {
            const player = ctx.source.entity;
            const charName = StringArgumentType.getString(ctx, "charName");

            if (player instanceof ServerPlayer) {
              KJSFigura.handle(player, charName, false);
            }

            return 1;
          })
      )
  );
});
下载与版本
评论(0)
请 登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

赞助作者

请 登录 后赞助作者。

🔥 相关推荐
Technical+

价格:0 墨喵币
下载量:0

查看详情
Improved Torches

价格:0 墨喵币
下载量:0

查看详情
Leaf Cutter

价格:0 墨喵币
下载量:0

查看详情
ParkourEngine

价格:0 墨喵币
下载量:0

查看详情