#potion drop triggering item

1 messages · Page 1 of 1 (latest)

blazing mist
#

How to make player throw splash potion that depends where is he facing? Like normal potion?

world.afterEvents.itemUse.subscribe((event) => {
    const player = event.player;
    if (event.itemStack.typeId !== 'a:splash_potion_poison') return;
    throwPotion(player);
});
 function throwPotion(player) {
       // …
}

Someone help

blazing mist
#

anyone

nimble reef
#
const view = player.getViewDirection()
let entity = player.dimension.spawnEntity("potion_entity_typeId", {
  x: player.location.x + view.x,
  y: player.location.y + 1.5,
  z: player.location.z + view.z
})
let comp = entity.getComponent("minecraft:projectile")
if (comp) {
  comp.shoot(view)
  comp.owner = player
}

// Decrement itemStack code...
blazing mist
#

tyyyy

blazing mist
blazing mist
nimble reef
#

entity.addTag("myPotion")

blazing mist
nimble reef
#

Too many questions, check documentation