#Movement Stuff (Unsure if this is right channel)
1 messages · Page 1 of 1 (latest)
So, that isn't really as much of a molang thing AFAIK. The methods I know of are using a ridden entity with a set velocity, or applying knockback with scripts
using scripting, not molang
function moveToPoint(entity, destination, startLoc) {
const posDiff = {
x: destination.x - startLoc.x,
y: destination.y - startLoc.y,
z: destination.z - startLoc.z
};
if (entity.typeId === "minecraft:player") {
entity.applyKnockback(posDiff.x, posDiff.z, Math.sqrt(posDiff ** 2 + posDiff.z ** 2), posDiff.y);
} else {
entity.applyImpulse(posDiff)
}```
thats an example
obviously this isnt a smooth movement its just an example
my bad, but whats the difference between how molang and scripting is coded?
scripting is similar to modding in simple words (not really but similar), its javascript you can do almost everything, molang return values that you can use in conditions, animations and other things that support molang but you cant use it in entity component values as minecraft:knockback_roar because its json, json its all similar to presets
scripting is javascript and you can do almost everything, its just 100x times better
I highly recommend to you to learn scripting