#is this array incorrect?
1 messages · Page 1 of 1 (latest)
You’re comparing a string (.typeId) to an array turned into a string ('${mobs}') so it will always be false- what you’re wanting to do here is do mobs.includes(hurtEntity.typeId) which will check if the array mobs includes the hurt entity type
oh mb
And ==+ returns true because you’re adding the array string to the string (which will always be true)
idk how ive gone this long without having to use a single array
They’re very useful
so .includes detects if the typeId includes any of the values in the array?
If the array includes the typeId
if (mobs.includes(typeId))
Means “if the array ‘mobs’ includes the typeId, return true”