#[RESOLVED] make an item projectile without losing it.
1 messages · Page 1 of 1 (latest)
nvm i figured it out.
just stack to 2.
There is a way to do it and only have one item instead of 2
In case its too unsightly, but it uses scripting (in case you are against scripting)
i dont hate scripting
i can do that effortlessly
You can just make a script to summon the entity and apply projectile Knockback to it
I have a script that does this if usually want, but it wouldn't be hard to do at all
oh yeah we can do that with applyImpulse or applyKnockback
I meant that there is a projectile.shoot conponent that can be accessed in script
do you know how to lear n scripting
i know basices of javascript but dont know where to start
Yes
I would strongly reccomend the scripting sections of the bedrock wiki
I'll send some link(s) that you might find useful
thx bro
No problem
I need this
Can you share the script?
Of course
Here
import {world, system} from "@minecraft/server";
world.afterEvents.itemUse.subscribe(({ source, itemStack }) => {
if (itemStack.typeId == 'item:name') {
const player = source;
const head = player.getHeadLocation();
const view = player.getViewDirection();
const bullet = player.dimension.spawnEntity('entity:name', head);
const proj = bullet.getComponent('projectile');
proj.owner = player;
proj.shoot({ x: view.x * 1.5, y: view.y * 1.5, z: view.z * 1.5 });
}
})```