« Back to search

Mod

X Player API

by SaKeL · score 598.0 · license: LGPL-2.1-or-later

X Player API

Download latest release

Realistic biomechanical character animations, glTF multi-track support, dual visual proxies, and drop-in replacement for player_api.

library skins tools

A high-fidelity player visual and animation management mod for Luanti that upgrades the default player model with glTF multi-track animations, realistic athletic biomechanics, and a stylized futuristic character skin while maintaining 100% backward compatibility with canonical 6-bone skins and armor.

Features

  • Dual-Model Visual Proxies & Observer Filtering: Seamlessly serves modern .glb models to Luanti 5.17.0+ clients and fallback .b3d models to older clients on the same server via set_observers network culling, with 0.08 rad bone override throttling.
  • Pure Native B3D Option: Optional zero-proxy mode (x_player_api.pure_native_b3d = true) applying B3D meshes directly to the native player entity with hardware-smooth client prediction for stand, walk, mine, and walk_mine.
  • Multi-Track glTF Support (.glb): Native multi-track named animation channels for Luanti 5.17.0+ with GPU skeletal blending.
  • Athletic Locomotion (walk, sprint): Realistic gait kinematics with transverse pelvic yaw, double-bounce vertical oscillation, forward torso lean, 3D curved arm swings, and head gaze stabilization.
  • Diaphragmatic Breathing (stand): Organic respiration cycle with ribcage expansion, asymmetrical resting stance, and secondary arm breathing movement.
  • Dynamic Kinetic Strike (mine, walk_mine): Athletic full-body mining action with torso coiling anticipation, downward core drive, explosive impact snap, and elastic recoil recovery.
  • High-Definition Character Texture: Clean futuristic style featuring ceramic composite armor plating, carbon fiber tech suit, and glowing electric cyan power core.
  • Declarative Equip Sound Registry: Dynamic sound playback and equip animation montages when switching weapons, tools, and items, with group fallbacks, direct item registration (register_equip_sound), and custom item definition overrides.
  • Agnostic Extensible API: Flexible registries for custom consumables (register_consumable), action rules (register_action_rule), and dynamic multi-track animations (play_action, register_model).
  • 100% Skeletal Compatibility: Retains canonical 6 bones (Body, Head, Arm_Left, Arm_Right, Leg_Right, Leg_Left) plus Cape channels for compatibility with skins and armor.
  • Seamless player_api Drop-in Override: When enabled, fully replaces and overrides the default player_api methods, model registrations, and globalstep logic while transparently resolving modpaths.
  • Native 3D Wield Items: Ephemeral child entity rendering with visual = 'wielditem' attached to Arm_Right, supporting custom anisotropic wield_scale, pivot translation drift compensation, and 3d_armor compatibility.

Developer API

-- Register custom glTF models with named tracks and classic frame ranges
player_api.register_model("character.glb", {
    animation_speed = 30,
    textures = {"character.png"},
    animations = {
        stand = {track = "stand", x = 1, y = 79},
        walk = {track = "walk", x = 168, y = 187},
        mine = {track = "mine", x = 190, y = 200},
        walk_mine = {track = "walk_mine", x = 201, y = 220},
        sprint = {track = "sprint", x = 221, y = 237},
        eat = {track = "eat", x = 476, y = 496},
        equip = {track = "equip", x = 730, y = 740, loop = false},
    }
})

-- Register food item consumable for particle burst and eating animations
player_api.register_consumable("farming:bread", {
    sound = "default_eat_crumb",
    duration = 1.2,
    particles = true,
})

-- Set player animation or play custom action track
player_api.set_animation(player, "walk", 30)
player_api.play_action(player, "eat", 1.2)