Skip to main content

AdvancedHunt heads

AdvancedHunt hides player heads around the world for players to find. This page sets up a collection that tracks how many a player has found and pays a reward once they have found them all, adjusting itself when you add or remove heads later.

How the integration works

AdvancedHunt has no developer API, so zCollections reads it through PlaceholderAPI. You need PlaceholderAPI installed, plus the AdvancedHunt expansion that provides its placeholders.

The two placeholders this uses are:

PlaceholderReturns
%advancedhunt_found_treasures_<group>%How many heads this player has found
%advancedhunt_max_treasures_<group>%The total number of heads in that group

<group> is the id of the AdvancedHunt spawn group. The total is server-wide, so the goal is the same for everyone and changes the moment you add or remove heads.

Find your group id

The group id sits at the end of both placeholders. Open your AdvancedHunt config and find the spawn group you want to track, then test the placeholder in game with PlaceholderAPI:

/papi parse me %advancedhunt_found_treasures_<group>%
/papi parse me %advancedhunt_max_treasures_<group>%

If both return numbers, you have the right group id. The id is unique to your server, so use your own value, not one copied from anywhere else.

Add the collection

Paste this under categories: in categories.yml, replacing <group> in both placeholders with your group id, and change the reward to whatever you want to give. Run /collection reload afterwards.

heads:
display-name: '&eHeads'
icon: PLAYER_HEAD
description:
- '&7Find every head on the server.'
resources:
heads:
display-name: '&eHeads'
material: PLAYER_HEAD
trigger:
type: STAT
stat: PLACEHOLDER
placeholder: '%advancedhunt_found_treasures_<group>%'
goal-placeholder: '%advancedhunt_max_treasures_<group>%'
unlocked-lore:
- '&7Found: &f{current}&8/&f{next}'
- ''
- '&7Reward when all are found:'
- '&8- &f{next-reward-summary}'
tiers:
- threshold: 1
rewards:
- 'money:50000'
reward-description:
- '&6$50,000'

The goal-placeholder

This collection uses goal-placeholder instead of fixed tier thresholds. With it set, the resource has a single tier that completes when the tracked value reaches the live goal. You do not set a number for the total: the plugin reads it from max_treasures every poll, so if you add or remove heads later the target follows along on its own.

The threshold: 1 in the snippet is still required so the tier parses, but it is ignored once goal-placeholder is present. The reward is given once, when the player has found every head.

info

STAT resources refresh on a timer set by divers.poll-interval in config.yml (default 60 seconds), so the found count and the reward update on the next poll, not the instant a head is found.

Custom head icon (optional)

To show a custom skull as the icon instead of the plain head, keep material: PLAYER_HEAD (and icon: PLAYER_HEAD on the collection) and add a texture line with the base64 head value:

heads:
display-name: '&eHeads'
material: PLAYER_HEAD
texture: 'ewogICJ0ZXh0dXJlcyIgOiB7...'

The base64 value is the long string from a head site or a /skull-style command. It is ignored on any other material, and a bad value just falls back to a plain head.

Claim or auto mode

This works in both reward modes set by rewards.mode in config.yml:

  • auto: the reward is paid automatically once the player has found every head.
  • claim: the completed tier becomes claimable in the resource menu, like any other.