#how can i run custom blank item's component as arrow using bridge v2

1 messages · Page 1 of 1 (latest)

foggy girder
#

this code isn't working in the minecraft gamenand also there's no suggestion in the "minecraft:on_use" in the bridge

{
"format_version": "1.20.80",
"minecraft:item": {
"description": {
"identifier": "bridge1:nsuz",
"menu_category": {
"category": "nature"
}
},
"components": {
"minecraft:icon": "bridge1_nsuz",
"minecraft:on_use": {
"on_use": {
"event": "bridge1:example",
"target": "self"
}
}
},
"events": {
"bridge1:example": {
"shoot": {
"projectile": "arrow",
"launch_power": 5,
"target": "other"
}
}
}
}
}

amber zealot
#

I'm not sure if events work in items (I know they used to in older versions but currently I use script for on use)

foggy girder
#

do you know any relevant new video tutorials where i can learn

amber zealot
#

Script wise I learned from looking at other addons and piecing it together with microsoft learn....
I can try to put together the way I do it but that will take some hours...

foggy girder
#

well, i’m totally a new bie, are you using bridge or vscode?

hexed ferry
#

Yeah events were removed you now to need code a custom component with a script https://wiki.bedrock.dev/items/item-events this guide explains how.

amber zealot
#

ok, that should be it (aside from the texture atlas)
and import { world, system, EquipmentSlot, GameMode, Player} from "@minecraft/server"; is in the beginning of the script

amber zealot