#Adding an Array, and applying it
1 messages · Page 1 of 1 (latest)
where are you applying it?
to the code in the stacking and system.runSchedule
i have it as the cow entity, i need to make it dynamic
just search mrleefy:cowstill and its pretty much in those spots
the hurtEntity is already defined, i just need to edit the definitions. Let me get a clip
const entity = dimension.spawnEntity('mrleefy:cowstill', new Location(x, y, z))
and here
system.runSchedule(() => {
const entities = world.getDimension("overworld").getEntities({type: 'mrleefy:cowstill'})
i dont really understand but
world.events.entityHurt.subscribe(evd => {
const damaginEntity = evd.damagingEntity
const mobs = [`minecraft:creeper`, `minecraft:skeleton`, `minecraft:spider`, `minecraft:zombie`, `minecraft:blaze`]
const hurtEntity = evd.hurtEntity
if (hurtEntity.getComponent("health").current <= 0 && mobs.includes(hurtEntity.typeId)) {
damaginEntity.runCommandAsync('scoreboard players add @s currentXP 10')
}
}
)```
i just had a similar issue and this is waht the working array looks like for mine so
ifk if this will help you or now
oh okay let me take a look
mobs.includes(hurtEntity.typeId)
``` this is where the array is used
const mobs = [`minecraft:creeper`, `minecraft:skeleton`, `minecraft:spider`, `minecraft:zombie`, `minecraft:blaze`]
``` and this is where its defined
got it yay