BlockEvents.broken(event => {

    if (!event.server || !event.player) return;

    const id = event.block.id;

    // Only dynamic tree branches
    if (!id.endsWith("_branch")) return;

    const playerName = event.player.username;

    // Correct category namespace (shown in your screenshot)
    const category = "puffish_skills:chopping_wood";

    // Get branch radius for XP scaling
    let radius = event.block.properties["radius"];
    if (!radius) radius = 1;

    const xp = Math.min(10, Math.max(1, radius));

    event.server.runCommandSilent(
        `puffish_skills experience add ${playerName} ${category} ${xp}`
    );
});
