#how to get a specific entity as a variable in my script
1 messages ยท Page 1 of 1 (latest)
Assuming dimension is defined.
const entities = dimension.getEntities();
for(const entity of entities) {
entity.applyKnockback();
}
Sorry i dont understand
i dont understand
import { world, system } from "@minecraft/server";
system.runInterval(() => {
const dimension = world.getDimension('overworld');
for (const entity of dimension.getEntities()) {
entity.applyKnockback(entity.location.x, entity.location.z, 2, 2)
}
});
// applyKnockback(directionX, directionZ, horizontalStrength, verticalStrength)
But that executes constantly
how can i execute that knockback only one time
bruh
also, i want to apply the knockback to an item
learn js pls
for simple js like this, you can ask to gpt for guide
What do you want to know?
@balmy wolf what are you trying to do?
Thats why you have to learn js
First
lol
I learned ๐