Trying to use Exposure to create Advancements on picturing Pokémon (Cobblemon) - NBT data of Cobblemon not pulled correctly.
Closed this issue · 6 comments
So I am having issues pulling NBT data from cobblemon:pokemon entities with the entities_in_frame pull. This is what I am doing:
{
"display": {
"icon": { "id": "exposure:photograph_frame" },
"title": { "text": "¡Go, Caterpie!" },
"description": { "text": "Fotograph a Caterpie." },
"show_toast": true,
"announce_to_chat": false,
"frame": "task"
},
"criteria": {
"caterpie_photo": {
"trigger": "exposure:frame_exposed",
"conditions": {
"entities_in_frame": [[
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type": "cobblemon:pokemon",
"nbt": "{Species:\"cobblemon:caterpie\"}"
}
}
]]
}
}
},
"requirements": [["caterpie_photo"]]
}
I have also tried using "id":" cobblemon:pokemon" and:
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type": "cobblemon:pokemon",
"name": "Pikachu"
}
But for some reason it is not pulling the species NBT data nor the name of the entity; it would use only the type which is generic to all Pokémon. I have tested it and it does work when I picture a Pokemon, but it triggers advancements for all, as pulling from cobblemon:pokemon only.
My intention is create advancements for photographing Pokémon, something Pokémon Snap style.
My last alternative would be to use a function that generates ray casts when taking a picture, identify the NBT data of the collided entity and hook the advancements to that, but I'd love to be able to work with the Exposure data directly, as it already pulls NBT data of the entity.
I think the issue is in your advancement definition. Look at the structure of built in advancements, for example: https://github.com/mortuusars/Exposure/blob/1.20.1/common/src/main/resources/data/exposure/advancements/adventure/exposed_paparazzi.json
{
"conditions": {
"exposure": {
"entity_in_frame": {
"type": "minecraft:skeleton",
<nbt...>
}
}
},
"trigger": "exposure:frame_exposed"
}Just tried adjusting it to comply with the built in structure:
{
"criteria": {
"metapod_shot": {
"conditions": {
"exposure": {
"entity_in_frame": {
"type": "cobblemon:pokemon",
"nbt": "{Species:\"cobblemon:metapod\"}"
}
}
},
"trigger": "exposure:frame_exposed"
}
},
"display": {
"frame": "task",
"hidden": false,
"show_toast": true,
"announce_to_chat": true,
"icon": {
"item": "exposure:photograph_frame"
},
"title": {
"text": "Retrato: Metapod"
},
"description": {
"text": "Fotografía a Metapod."
}
},
"requirements": [
[
"metapod_shot"
]
],
"sends_telemetry_event": true
}
This way no achievement jumps at all
And this seems to work but triggers every cobblemon:pokemon advancement that I create; even if photographing only one pokémon. So my guess is I am either not using the NBT data correctly to parse or exposure is not grabbing the entity data correctly.
Adding the nbt data from the cobblemon entity:

{
"criteria": {
"metapod_photo": {
"conditions": {
"exposure": {
"entity_in_frame": {
"type": "cobblemon:pokemon",
"nbt": "{Species:\"cobblemon:metapod\"}"
}
}
},
"trigger": "exposure:frame_exposed"
}
},
"display": {
"icon": { "id": "exposure:photograph_frame" },
"title": { "text": "¡Dilo, Metapod!" },
"description": { "text": "Fotografía un Metapod." },
"show_toast": true,
"announce_to_chat": true,
"frame": "task"
},
"requirements": [["metapod_photo"]]
}
No luck, it takes into consideration the "type": "cobblemon:pokemon" - not the nbt. So it triggers with any pokemon
{
"criteria": {
"metapod_photo": {
"conditions": {
"frame": {
"entities_in_frame_count": 1,
"entities_in_frame": [{
"type": "cobblemon:pokemon",
"nbt": "{Pokemon:{Species:\"cobblemon:metapod\"}}"
}]
}
},
"trigger": "exposure:frame_exposed"
}
},
"display": {
"icon": { "id": "exposure:photograph_frame" },
"title": { "text": "¡Dilo, Metapod!" },
"description": { "text": "Fotografía un Metapod." },
"show_toast": true,
"announce_to_chat": true,
"frame": "task"
},
"requirements": [["metapod_photo"]]
}
Any idea? It feels like It is not pulling the NBT data of the cobblemon mod correctly or I am not pulling it good. I actually have no idea, completely new to this. 🚬💀 I've tried multiple different ways.