AstralCollections exposes its services through AstralCollections.get() and persists player progress as an AstralSync data holder. Other plugins can hook in to add custom triggers, read progress, or grant collection entries programmatically.
If your plugin grants items in a way AstralCollections doesn't already see (custom event, gameplay mechanic, etc.), wire it up like this:
public class TreasureChestListener implements Listener {
private final AstralCollections collections;
public TreasureChestListener(AstralCollections collections) {
this.collections = collections;
}
@EventHandler
public void onLoot(MyTreasureLootEvent event) {
for (ItemStack stack : event.getLoot()) {
collections.collections()
.findByItem(stack)
.ifPresent(entry -> collections.collections().markDiscovered(event.getPlayer(), entry));
}
}
}
Placeholders
CollectionBlueprint and CollectionEntry both implement ComplexPlaceholder, so they slot directly into any AstralCore placeholder container. See Placeholders for the available keys.
To use a blueprint as a placeholder root manually: