Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advancement Criteria Questions - Location & Inventory Change #12

Open
BlatantDecoy opened this issue Jun 2, 2018 · 5 comments
Open

Comments

@BlatantDecoy
Copy link

https://github.com/skylinerw/guides/blob/master/java/advancements/triggers.md#location
For the Location criteria, it doesn't seem to allow negative coordinates - is there a way around this?

https://github.com/skylinerw/guides/blob/master/java/advancements/triggers.md#inventory_changed
Could you please do a guide on the nbt condition?

@BlatantDecoy BlatantDecoy changed the title Criteria Questions - Location & Inventory Change Advancement Criteria Questions - Location & Inventory Change Jun 2, 2018
@skylinerw
Copy link
Owner

Sorry for the late reply.

Negative values work for me in the latest snapshot. Make sure you're setting min to be the smaller of the two, otherwise you can provide the advancement here and I can check for any issues.

NBT fields are just the same as you'd use in commands. For example:

"nbt": "{Invulnerable:1b}"

However, keep in mind that nested quotes will need to be escaped with a backslash, otherwise those un-escaped quotes will close the field early, causing a syntax error. For example, the following is incorrect is will throw an error:

"nbt": "{SomeTag:"value"}"

While the following is correct:

"nbt": "{SomeTag:\"value\"}"

@BlatantDecoy
Copy link
Author

BlatantDecoy commented Jun 10, 2018

Hi, thanks for the reply.

I was using 1.12 when I opened the thread so I'll give 1.13 a try.

For nbt, in the case of multiple tags would this be correct?
{display:{Name:\"CustomName\",Lore:[\"Line1\",\"Line2\"]}},{Enchantments:[{id:#,lvl:#},{id:#,lvl:#}]}

@skylinerw
Copy link
Owner

You closed the root compound (indicated by curly brackets) and opened a new one. This will throw a syntax error (i.e. you have {data},{data} when it should be {data,data}). Fixed:

{display:{Name:\"CustomName\",Lore:[\"Line1\",\"Line2\"]},Enchantments:[{id:#,lvl:#},{id:#,lvl:#}]}

@BlatantDecoy
Copy link
Author

BlatantDecoy commented Jun 11, 2018

Thanks for the correction, I appreciate it.
Will using nbt check for items with ONLY that specific data or will it work like a checklist?
Eg item named CustomItem and lore as CustomLore, but the "nbt": is only {display:{name:\"CustomName\"}} would it still check for an item regardless of the lore, as long as it meets the name criteria?
Thanks.

@BlatantDecoy
Copy link
Author

{ "__comment": "Made with TheDestruc7i0n's advancements generator: https://advancements.thedestruc7i0n.ca", "display": { "title": "city", "description": "Visit city", "icon": { "item": "minecraft:furnace" }, "frame": "task", "show_toast": true, "announce_to_chat": false, "hidden": false }, "criteria": { "visit_city": { "trigger": "minecraft:location", "conditions": { "dimension": "overworld", "position": { "x": { "min": -7012, "max": -7016 }, "y": { "min": 102, "max": 102 }, "z": { "min": -7955, "max": -7961 } } } } }, "parent": "placeholder:tourist" }

I've just had another attempt in 1.13. The above doesn't work for me.
Here's a link to a pastebin version thats easier to look at https://pastebin.com/uxgzmi71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants