// Remove Wither Eye and Guardian Eye mob drops
EntityEvents.drops(event => {
  const entityType = event.entity.type

  if (entityType === 'minecraft:wither' ||  entityType === 'minecraft:elder_guardian') {
    event.drops.removeIf(drop => {
      let id = drop.item.id
      return id === 'endrem:wither_eye' ||  id === 'endrem:guardian_eye'
    })
  }
})

// Catch-all safety: Destroy any remaining instances if they land in the world (e.g. Cryptic Eye from enchanting)
ItemEvents.entitySpawned(event => {
  const forbiddenEyes = [
    'endrem:wither_eye',
    'endrem:guardian_eye',
    'endrem:cryptic_eye',
    'endrem:undead_eye'
  ]

  if (forbiddenEyes.includes(event.entity.item.id)) {
    event.entity.discard() // Instantly deletes the dropped eye entity
  }
})