x_player_api
ch.zizka.luanti.mods.SaKeL
ch.zizka.luanti.mods.SaKeL:x_player_api is a Maven Central artifact (jar) for the JVM. It has 1 published version. Browse versions below for dependency snippets and security details.
Add to your project39497
<dependency>
<groupId>ch.zizka.luanti.mods.SaKeL</groupId>
<artifactId>x_player_api</artifactId>
<version>39497</version>
</dependency>Version Details — 39497
Pure player visual & animation management API with glTF multi-track, dual visual proxies, and drop-in player_api replacement. 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. > **Pure API Integration**: `x_player_api` is strictly a pure API framework and does not bundle, support, or directly integrate any 3rd-party mods. Third-party mods can utilize this API to integrate seamlessly with the new player model. For a practical showcase and reference implementation of 3rd-party mod integration, see the companion `x_player_bridge` mod. ## 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 canonical skins. - **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 extensible attachment offsets for equipment mods. ## Developer API ```lua -- 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) ``` > ⚠️ **Warning: ContentDB AI Labeling** > > ContentDB is enforcing AI labels unfairly. Don't be misled by their AI labels. Based on their knowledge of AI, the time at which your code is committed or the commit message can cause the entire package to be labelled as AI-generated. > ℹ️ **AI Disclosure (Assisted)** > > Core logic, gameplay mechanics, and all media assets (textures, 3D models, audio) are 100% human-authored without generative AI. AI tools are used solely for auxiliary productivity—such as documentation drafting, commit formatting, and test scaffolding. All code is manually tested and verified by the maintainer.