Blockbench Plugins Repository

repository·master·Indexed 41 days ago

https://github.com/jannisx11/blockbench-plugins

A central repository for hosting and developing extensions for the Blockbench 3D modeling tool. Includes documentation for various plugins such as GeckoLib Animation Utils, Baked Ambient Occlusion, Bone View, Easy Model Entities, and Farsight.

Tokens
52.4K
Snippets
133
Records
279
Agent score
52%

What's inside Blockbench Plugins

  1. Hytale modeling and animation features

    master

    The Hytale plugin extends Blockbench with specific capabilities for Hytale assets:

    Modeling

    • UV Consistency: UV sizes are automatically locked to face dimensions.
    • Non-destructive Scaling: Use the stretch tool and sliders to adjust cube sizes without affecting UVs.
    • Attachments: Built on collections, allowing for items like hairstyles, clothing, or weapons to be attached to characters.

    Animation

    • Keyframe Support: Includes visibility keyframes, UV Offset keyframes, and keyframe-wrapping for looping.
    • Interpolation: Uses quaternion-based interpolation.
    • Scale Animation: Scale keyframes animate the stretch value of the attached cube.
  2. Features of the Animated Platforms plugin

    master

    The Animated Platforms plugin provides tools for creating moving platforms within Blockbench. Key capabilities include:

    • Movement Control: Set scroll speed in blocks per second (blocks/sec) with access to quick presets.
    • Transformations: Control size (width, length, height) and placement (rotation).
    • Texture Management: Use optional custom textures with the ability to rotate or flip them. Includes a texture library for rapid reuse.
    • Animation Presets: Save and auto-save specific settings per animation.

    Important Note: Custom texture rotation is a visual-only effect; the actual movement direction of the platform remains consistent regardless of how the texture is rotated.

  3. Use PAL Bend Player Tools for player animation conversion

    master

    PAL Bend Player Tools is a Blockbench plugin designed to create player animation projects and convert between different animation formats, specifically targeting PlayerAnimationLibrary, Emotecraft, and DragonCore.

    Key Capabilities:

    • Project Creation: Generates player_model.geo.json helper-bend projects with a default player_model.geo.png texture. It also supports creating DragonCore-compatible projects using either standard PAL bone names or specific DragonCore group names (e.g., Body_Lower, Body, Left_Arm_Lower, Right_Hand).
    • Importing:
      • Import traditional PAL bend animations JSON or Emotecraft emote JSON.
      • Import legacy animations authored for DragonCore and convert them to the PAL format.
      • Import flat PAL/emote animations into parented projects by unbaking them into local Blockbench bone tracks.
    • Exporting:
      • Export to traditional PAL bend animations JSON or Emotecraft emote JSON.
      • Bend Conversion:
        • If only X-axis rotation is present (*_bend.rotation.x), it exports in the original scalar PAL format.
        • If Y/Z rotation is present, it exports as a vector bend compatible with PlayerAnimationLibraryMoreRotation.
      • Baking: Export DragonCore-friendly parented projects as flat PAL bone animations by baking the current Blockbench hierarchy and pivots.

    Important Notes:

    • The plugin uses a preview model as a helper rig for editing bends within Blockbench.
    • While exported PAL animations use native bend, Emotecraft exports are limited to the single X-axis bend value supported by the emote JSON format.
  4. Features of Structure to Model

    master

    The Structure to Model plugin provides several automated processing features during the import of .nbt files:

    • Model Resolution: Correctly handles large structure palettes, default block states, and resolves variant, multipart, and inherited block models.
    • Optimization: Automatically culls hidden faces to reduce the complexity of the resulting Blockbench model.
    • Organization: Groups and names generated cubes based on their block type.
    • Texturing: Supports biome-tinted textures using either presets or custom colors.
    • UX: Displays a progress indicator during the import of large structures.
  5. Configure animation clips for Easy Model Entities

    master

    The mod automatically triggers specific animations based on the entity's state. To ensure your model animates correctly, name your Blockbench animation clips using the following reserved names:

    Clip NameTrigger Condition
    idleStanding still
    walkMoving on the ground
    swimMoving in water
    flyFlying
    attackAttacking
    sitSitting

    Other Clips:

    • hurt and death clips are loaded but are not automatically triggered by the mod.
    • Any other clip names are treated as custom clips. These can be played manually using the /easy_model_entities animation command or via other mods. If no matching clip is found for a state, the model renders without animation.
  6. Handle TypeScript errors in the plugin

    master

    The plugin uses TypeScript with types provided by blockbench-types. Because these types are hand-written, they may be incomplete or incorrect. TypeScript errors will be logged to the terminal but will not prevent the plugin from building.

    Strategies for fixing type errors

    If a type is genuinely missing or wrong, submit a PR to the blockbench-types repository. You can test these changes locally using npm link:

    1. Clone blockbench-types and use the same Node version as the plugin.
    2. Run npm link inside blockbench-types.
    3. Run npm link blockbench-types inside the plugin's src folder. Note: You must re-run npm link blockbench-types after every npm install.

    2. Workaround within the plugin

    • Type Assertions (Casting): Use as to cast to a target type. For insufficient overlap, use as unknown as <Target Type>.
      let easingBar: HTMLElement = document.createElement('div');
    • Type Annotations: Explicitly annotate parameters or variables.
      (kf: GeckolibKeyframe) => { } // Forces kf to be GeckolibKeyframe instead of Keyframe
    • Subclassing: Subclass a Blockbench type.
    • Type Narrowing: Use standard TypeScript narrowing techniques.

    3. The "Nuclear" Option

    If all else fails, use // @ts-ignore above the line to suppress all type checking for that specific line.

    // Example of type assertion
    const myVar = someValue as unknown as TargetType;
    
    // Example of type annotation
    let easingBar: HTMLElement = document.createElement('div');
  7. How Animation Syncing works in Batch Rename

    master

    When the Also Update Animation Names option is enabled, the plugin ensures that renaming groups does not break existing animations.

    It checks project animations and updates matching animator names if they are tied to:

    1. The renamed group's UUID.
    2. The group object.
    3. The old group name.

    The model group rename and the animation-name update are committed in a single undo step, so Ctrl+Z will revert both simultaneously.

  8. Handle TypeScript errors and type definitions

    master

    The plugin uses TypeScript with types provided by the blockbench-types package. Because these types are hand-written, you may encounter errors even if your code is correct.

    Strategies for resolving type errors:

    1. Fix the source types: Submit a PR to blockbench-types. You can test local type changes using npm link (link blockbench-types locally, then run npm link blockbench-types in the plugin's src folder).
    2. Massage types locally:
      • Type Assertions (Casting): Use as <Target Type> or as unknown as <Target Type>.
      • Type Annotations: Explicitly annotate variables or parameters: (kf: GeckolibKeyframe) => { }.
      • Subclassing: Subclass a Blockbench type.
      • Type Narrowing: Use standard TypeScript narrowing techniques.
      • Declaration Merging.
    3. The Nuclear Option: Use // @ts-ignore above the line to suppress all type checking for that specific line.