import { world } from "@minecraft/server";

const FORTUNES = [
  "Great fortune smiles upon you today!",
  "Your builds will be legendary.",
  "A lucky find awaits you soon.",
  "Adventure and treasure lie ahead!",
  "The cat's blessing brings you luck.",
  "Today is a perfect day to explore.",
  "Fortune favors the bold builder!",
  "Something wonderful is about to happen.",
  "The paw that waves beckons prosperity your way.",
  "Keep going — great things await you!",
];

world.afterEvents.playerInteractWithEntity.subscribe((event) => {
  if (event.target.typeId !== "silverlabs:anthrax_cat") return;

  const player = event.player;
  const fortune = FORTUNES[Math.floor(Math.random() * FORTUNES.length)];

  player.sendMessage(`§6[✦ Anthrax Cat] §e${fortune}`);
});
