Exposure

Exposure

5M Downloads

Trying to use Exposure to create Advancements on picturing Pokémon (Cobblemon) - NBT data of Cobblemon not pulled correctly.

Closed this issue · 6 comments

commented

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.

commented

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"
    }
commented

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

commented

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:
Image

{
  "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"]]
}
commented

Try this: "nbt": "{Pokemon:{Species:\"cobblemon:metapod\"}}"

commented

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.

commented

I fixed it. I was looking at the wrong NBT data. I was looking at the pokemon data, not the frame data; frame data goes by name and id - so all good now!