HomeJavaModsPrototype: Physics
Prototype: Physics
ModsJava

Prototype: Physics

by AdInVas · on CurseForge

A simple Physics library adding player Ragdolls.

⬇ Download on CurseForge

The author built this one for Minecraft 1.20.1 on Forge. On other versions it may install and then do nothing.

A simple Experimental Ragdoll library for Minecraft Player.
Uses Jbullet Physics engine.

Mod Adds following events for interacting with the Physics.

PlayerPartHitEvent
RagdollModeChangeEvent
RagdollClickEvent


Example Usage:

@SubscribeEvent
public static void onPPI(RagdollClickEvent event){
var player = event.getSource();
var part = event.getTarget();
System.out.printf("%s| %s| %s| %s",
player.getName().getString(),
part.getName().getString(),
event.getPartName(),
event.getContactPoint()
);
// e.g., apply damage, play sound, spawn particles, etc.
}



example for Applying velocities and Rotations:

@SubscribeEvent
public static void onRagdolClick(RagdollClickEvent event){
JbulletWorld jworld = JbulletWorld.get((ServerLevel)event.getSource().level());
PlayerPhysics playerPhysics = jworld.getPlayerPhys(event.getTarget());
playerPhysics.applyVel(RagdollPart.TORSO,new Vec3(0,4f,0));
}

 

@SubscribeEvent
public static void onRagdolClick(RagdollClickEvent event){
JbulletWorld jworld = JbulletWorld.get((ServerLevel)event.getSource().level());
PlayerPhysics playerPhysics = jworld.getPlayerPhys(event.getTarget());
playerPhysics.applyTorque(RagdollPart.TORSO,new Vec3(0,4f,0));
}




Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more