Dynamic Inputs - GiantLuigi4/Minecraft_Effekseer_Implementation GitHub Wiki
For a lot of things, you will probably need more control over your effeks.
To do this, you need an Dynamic Input and an expression.
Here's a simple expression to rotate the effek based off dynamic inputs.
@O.x = @In0
@O.y = @In1
@O.z = @In2
Here's where you can find the above effek
In the effek above, Controller has its rotation set to "ParamaterType Fixed"
, and the "Ex."
or "Expression" set to the Rotation expression
Mover just moves on a linear path at a speed of 1 on the z axis
Effek effek = Effeks.get("test:bullet");
if (effek != null) {
EffekEmitter emitter = effek.getOrCreate("test:test");
emitter.setPosition(
Minecraft.getInstance().player.getPosX(),
Minecraft.getInstance().player.getPosY(),
Minecraft.getInstance().player.getPosZ()
);
emitter.setPaused(false);
emitter.setDynamicInput(0, (float)Math.toRadians(Minecraft.getInstance().player.rotationPitch));
emitter.setDynamicInput(1, (float)Math.toRadians(-Minecraft.getInstance().player.rotationYaw));
emitter.setDynamicInput(2, 0);
}
}
Here's some sample code to make the effek rotate based off the direction the player's looking