import * as mc from '@minecraft/server'

mc.system.runInterval(() => {
  try {

    const allEntities = [
      ...mc.world.getDimension("overworld").getEntities(),
      ...mc.world.getDimension("nether").getEntities(),
      ...mc.world.getDimension("the_end").getEntities(),
    ];
    for (const entity of allEntities) {
      const block = entity.dimension.getBlock(entity.location)
      if (block?.typeId === 'cyd_dino:bone_spikes') entity.applyDamage(1, { cause: mc.EntityDamageCause.contact })
    }
  } catch (e) { }

}, 0.5 * mc.TicksPerSecond) 