#Tagging Attacked entities

1 messages · Page 1 of 1 (latest)

rare ocean
#

I need to tag an entity when it is hit with a specific item. I have some custom items here that needs those functionality.

radiant folio
#

Your best bet would be to use a script. I don't know the exact details, but you would most likely need to use world.afterEvents.entityHitEntity (docs here: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/entityhitentityafterevent?view=minecraft-bedrock-stable). In there, you can check if the attacker is holding your item, and then add the tag to the hit entity if the attacker is

Contents of the @minecraft/server.EntityHitEntityAfterEvent class.

exotic burrow
#

yeah you'll have a easier time using scripts for it than using alternative methods which are usually very bulky in comparison

rare ocean
#

Like sample codes

#

also just to clarify
MCPE uses java script right?
not java