WorldSeed Entity Engine
repository·master·Indexed 42 days ago
https://github.com/atlasengineca/worldseedentityengineA library for Minestom that enables the import and use of Blockbench bedrock models in Vanilla Minecraft. WSEE allows for the creation of multipart entities with complex animations, AI, and specialized classes like EmotePlayer for transparent player entities. Version 13.0.1 requires the VM argument `--add-opens java.base/java.lang=ALL-UNNAMED` for the Molang compiler to function.
What's inside WSEE
- Due to Minecraft limitations, all bones in your model must be less than 64 blocks in size.
Install WorldSeed Entity Engine (WSEE)
masterTo use WSEE in your project, add the AtlasEngine repository to your
build.gradle.ktsand include the library as a dependency.Note: WSEE currently only supports Minestom.
repositories { maven("https://reposilite.atlasengine.ca/public") } dependencies { implementation("net.worldseed.multipart:WorldSeedEntityEngine:13.0.1") }Configure VM Arguments for Molang Compiler
masterWSEE requires specific VM arguments to allow the Molang compiler library to function correctly. Add the following flag to your run configuration to avoid
InaccessibleObjectException:--add-opens java.base/java.lang=ALL-UNNAMED--add-opens java.base/java.lang=ALL-UNNAMEDTroubleshoot WSEE model issues
masterCommon issues and solutions:
- Incorrect bone positioning: Entities are placed at the bone's pivot point in Blockbench. Solution: Move the pivot point closer to the bone.
- Model not working: Solution: Ensure the model type is set to
Bedrock Modelin Blockbench. InaccessibleObjectException: Solution: Ensure the required VM arguments (--add-opens java.base/java.lang=ALL-UNNAMED) are added to your run configuration.ModelDamageEventorModelInteractEventnot triggering: Solution: You must create hitboxes for the model (refer to the Hitboxes documentation).
Use EmotePlayer for transparent player entities
masterThe
EmotePlayerclass provides a WSEE model that uses an invisible Minestom entity as its carrier. It renders as a player skin and automatically applies vanilla idle, walking, looking, and hand-swing animations.Key features:
- Movement/Rotation: Controlled via standard Minestom entity APIs.
- Held Items: Use
setItemInMainHandandsetItemInOffHandto control visible items. Items remain attached to arms during animations. UseItemStack.AIRto clear a hand. - Animation Control: Use
setVanillaAnimationsEnabled(false)to give custom Blockbench animations complete control over player bones, then re-enable it to return to the automatic vanilla system. - Cleanup: Removing the
EmotePlayerautomatically removes its model bones and held-item displays.
PlayerSkin skin = new PlayerSkin(textureValue, textureSignature); EmotePlayer actor = new EmotePlayer(instance, new Pos(0, 42, 0), skin); actor.addViewer(player); actor.setVelocity(new Vec(0.1, 0, 0)); actor.setItemInMainHand(ItemStack.of(Material.DIAMOND_SWORD)); actor.setItemInOffHand(ItemStack.of(Material.SHIELD)); actor.swingMainHand(); // Playing Blockbench animations actor.loadEmotes(emotes); actor.getAnimationHandler().playOnce("wave", () -> {}); actor.getAnimationHandler().playRepeat("dance");Rotate a point using ModelMath.rotate()
masterThe
ModelMath.rotate(Point vector, Point rotation)method applies a 3D rotation to a givenPointusing Euler angles. Therotationparameter is expected to be in degrees. The method internally converts the rotation to radians and applies a rotation matrix sequence of X, then Y, then Z (Z * Y * X order).import net.worldseed.multipart.ModelMath; import net.minestom.server.coordinate.Point; Point originalPoint = new Point(1.0, 0.0, 0.0); Point rotationDegrees = new Point(0.0, 90.0, 0.0); // Rotate 90 degrees around Y axis Point rotatedPoint = ModelMath.rotate(originalPoint, rotationDegrees);