#'dataDrivenEntityTrigger' help;

1 messages · Page 1 of 1 (latest)

frail sierra
#

code:

world.afterEvents.dataDrivenEntityTrigger.subscribe(ev => {const {entity, eventId} = ev;
  if (entity?.typeId === 'minecraft:bee') {if (eventId === 'angry_bee') entity?.setDynamicProperty('angry', true); else entity?.setDynamicProperty('angry', false); if (eventId === 'angry_bee' && eventId === 'has_nectar') entity?.setDynamicProperty('angry_nectar', true); else entity?.setDynamicProperty('angry_nectar', false)};
  if (entity?.typeId === 'minecraft:wolf') if (eventId === 'minecraft:wolf_angry') entity?.setDynamicProperty('angry', true); else entity?.setDynamicProperty('angry', false);
});;```it should set a dynamic property to the bee / wolf after the specific event happens, but it doesn't give them any dynamic properties, what should i do to make it works?
tender scroll
abstract grove
#

I love it when vanilla mobs don't follow convention. If this is true, then vanilla bee events cannot be detected via scripting?

tender scroll
#

Lets double test this.

frail sierra
frail sierra
frail sierra
abstract grove
#

Something like that, yeah. In theory.

frail sierra
#

mhm

abstract grove
#

It would be worth testing it specifically. That is, make an event you know is not namespaced, then trigger it to then know you are certain it was executed. If the script fails to detect it, you have your answer

frail sierra
#

the script is probably wrong, somehow

#

also there's something called modifiers in it, something like addedComponentGroups

bronze lotus
frail sierra
#

i need help cuz even this:

world.afterEvents.dataDrivenEntityTrigger.subscribe(({eventId}) => {
  if (eventId === 'minecraft:wolf_angry') console.warn('0');
  if (eventId?.includes('minecraft:wolf_angry')) console.warn('1');
})```does not work
tender scroll
frail sierra
#

sorry i forgot that was a thing