#Add Attribute to All Entities

9 messages · Page 1 of 1 (latest)

twilit wave
#

I am looking to add an attribute to all entities spawn. IE: All entities have fire damage attribute, though it starts at 0.

If there is documentation on it, all I need to be is pointed to it. I couldn't figure out where the documentation on EntityEvents.spawned is.

wanton coyoteBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

twilit wave
#
EntityEvents.spawned((event) => {
  let entity = event.entity;
  if (entity.isLiving()) {
    entity.getAttribute('attributeslib:fire_damage').baseValue = 1;
  }
});```
twilit wave
#

Hoping to keep this open so someone might find a way to allow me to do this without having to set it to a number larger than 0

steady stormBOT
rare moss
#

entityjs has an attribute modify event which would look like this js EntityJSEvents.attributes(event => { event.getAllTypes().forEach(type => { event.modify(type, attribute => { attribute.add('attributeslib:fire_damage', 0) }) }) })

#

this is a startup script