Skip to content

Platform-independent Bedrock animation engine library for server-side entity animation baking

License

Notifications You must be signed in to change notification settings

EaseCation/BedrockMotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BedrockMotion

Platform-independent Bedrock animation engine library. Extracted from ViaBedrockUtility for shared use between client-side mods and server-side proxies.

Overview

BedrockMotion provides a complete Bedrock entity animation pipeline with zero Minecraft client dependencies:

  • Animation Engine — Keyframe interpolation, blend weights, MoLang-driven conditional playback
  • Animation Controllers — State machine with transitions, blend curves, shortest-path blending
  • Render Controllers — MoLang-based geometry/texture/material selection
  • Resource Pack Parsing — Load animations, controllers, models, and render controllers from Bedrock .mcpack files
  • MoLang Engine — Cached parsing and evaluation with LayeredScope / OverlayBinding for performance

Architecture

┌─────────────────────────────────────────────────────┐
│                   BedrockMotion                      │
│              net.easecation.bedrockmotion            │
│                                                      │
│  model/        IBoneTarget, IBoneModel interfaces    │
│  animator/     Animation execution (Animator)        │
│  controller/   Animation controller state machine    │
│  render/       Render controller evaluator           │
│  mocha/        MoLang engine wrapper                 │
│  pack/         Resource pack parsing (PackManager)   │
│  animation/    Data models + keyframe interpolation  │
└────────────┬────────────────────────┬────────────────┘
             │                        │
   ┌─────────▼─────────┐   ┌─────────▼─────────┐
   │ ViaBedrockUtility  │   │ ViaBedrock         │
   │ (Client Mod)       │   │ (Proxy)            │
   │                    │   │                    │
   │ MC ModelPart       │   │ SimpleBone         │
   │ adapter            │   │ adapter            │
   └────────────────────┘   └────────────────────┘

Usage

Dependency (Gradle)

repositories {
    mavenLocal()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'net.easecation:bedrock-motion:1.0.0'
}

Implement bone interfaces

public class MyBone implements IBoneTarget {
    // Implement rotation, offset, scale storage
}

public class MyBoneModel implements IBoneModel {
    // Implement bone index and reset
}

Load resource packs and run animations

// Load packs
Content content = new Content(zipBytes);
PackManager packManager = new PackManager(List.of(content));

// Create animator
AnimationDefinitions.AnimationData animData = packManager.getAnimationDefinitions()
    .getAnimations().get("animation.entity.idle");
Animator animator = new Animator(eventListener, animData);

// Each tick
animator.setBaseScope(frameScope);
boneModel.resetAllBones();
animator.animate(boneModel);

Building

./gradlew build
./gradlew publishToMavenLocal

Requires Java 17+.

Dependencies

Library Purpose
mocha MoLang parser and runtime
CubeConverter Bedrock geometry/entity data models
JOML Math (vectors, matrices, quaternions)
Gson JSON parsing

License

GPL-3.0 — see ViaBedrock for upstream license.

About

Platform-independent Bedrock animation engine library for server-side entity animation baking

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages