#custom shield like vanilla shield in script
1 messages · Page 1 of 1 (latest)
player.applyKnockback()
Is that all in the code?
@sly glacier sorry for ping I need to know I add item.typeId for this
?
wdym'
I mean, where I put it in class like itemuseon or other class
Like this?
import { world } from "@minecraft/server"
world.beforeEvents.ItemUseAfterEvent.subscribe(({ source, item }) => {
if (item.typeId == "shields:custom_shield") {
const player = source
player.applyknockback()
}
})
try it, im not sure about that, maybe entityHit?
@swift jay I'm gonna write a script like this soon, so I'll keep you updated
Thanks