Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
KubeJS Figura

KubeJS Figura

Offers some basic Figura capabilities designed for use with KubeJS by server developers.

390
0
Library
Utility
AboutChangelogVersions

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;
          })
      )
  );
});

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

1.20.1–1.20.6

Platforms

Forge

Supported environments

Client and server

Links

View source

Creators

confect1on
confect1on Member

Details

Licensed PolyForm Noncommercial 1.0.0
Published 2 months ago
Updated 2 months ago

Modrinth is open source.

main@aaf125c

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.