#Making custom advancement which you get after finishing building a certain things?

1 messages · Page 1 of 1 (latest)

nocturne patrol
#

Hi, Im new to datapacks and i was wondering. Is it possible to make an advancement which you get after finishing simple skyblock-like cobblestone generator? Are there some conditions i can use for that or its not possible? What i would like to make is getting advancement when water meets lava and im not sure how to begin or what conditions i should use. Sorry if i used wrong tag, im not sure which one i suppose to use since there is no advancement tag.

nova karma
#

It's not easily possible, as advancement run as and at the player but maybe there is a clever work around..

#

I’d this on an actual skyblock map? Can you maybe check for a specific amount of cobblestone?

#

You could "brute force" it and check for such a combination any time the player uses a bucket of lava and water. Although "checking for such a combination" is quite difficult

#

You can also just assume that, if the player uses water and lave right after each other, they made a generator

nocturne patrol
#

hmm...now when im looking at criteria and triggers ive noticed "minecraft:inventory_changed"

#

i could just check for cobblestone to show in inventory and give achievement, tho its far from what i want it seems the easiest and most possible way

nova karma
#

You can also combine that, so it checks that you

  1. have placed water,
  2. have placed lava and
  3. have collected cobblestone,
    To prevent some misfires
nocturne patrol
#

yeah but i dont know how to do it, idk how to check "if" in datapacks, im thinking rn how to put achevements in one tab instead of two because ive made two new achievements but they are in different tabs, i thought keeping them in one subfolder will do the trick but nope

#

i started with datapacks like 5 hours ago

#

i got used to recipes and loot tables and sofar advancements are hardest for me hah

nova karma
#

You can't really check "if" in advancements but you can use multiple criteria and then, the advancement only "fires" if all of them are completed

#

To check if you placed a block you'd use the item_used_on_block criteria and to check for cobblestone, like you said, the inventory_changed criteria

nocturne patrol
#

item_used_on_block, i've tried it but i have problems implementing it even with preview im not sure how to bend it to my needs

nova karma
nocturne patrol
#

ahh, so i need to add something to root.json

nova karma
nocturne patrol
#

aight, i will play with it till it works

nova karma
#

👌🏼 report back if you're stuck ;)

nocturne patrol
#

okay thanks

#

oh actually @nova karma

#
{
  "criteria": {
    "example": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "location": {
          "biome": "minecraft:gravelly_hills",
          "block": {
            "tag": "minecraft:campfires"
          }
        },
        "item": {
          "items": [
            "minecraft:porkchop"
          ]
        }
      }
    }
  }
}
#

this is example code for item used

#

now can i skip biome?

#

completely remove it so it works on every biome

nova karma
#

Yes, just remove it ^^

nocturne patrol
#

aight!

#

yeah, i already got stuck, i dont understand this trigger
soo i want to test if i get achievement after placing water on dirt

#
{
    "display": {
        "icon": {
            "item": "minecraft:cobblestone"
        },
        "title": "name",
        "description": "description"
    },
    "criteria": {
        "water_test": {
            "trigger": "minecraft:item_used_on_block",
            "conditions": {
                "location": {
                    "block": {
                        "tag": "minecraft:dirt"
                    }
                },
                "item": {
                    "items": [
                        "minecraft:water_bucket"
                    ]
                }
            }
        }
    }
}
#

and it aint working but i have no idea whats wrong

nova karma
#

Try to remove the whole "location" part (including the dirt block) and see if that works

#

It should then work on all blocks

nocturne patrol
#

oh!

nova karma
#

Also, it doesn't work because you are referring to a block tag but you are giving it a block

#

Block tags are lists of multiple blocks

nocturne patrol
#

oh, okay then i misunderstood what tag is

nova karma
#

It’s a different file all together ^^

nocturne patrol
#

and no its not working

nova karma
#

Do you see the advancement in the "autocomplete" if you try to run advancement give @s only …?

#

Or advancement revoke …

nocturne patrol
#

no, its not showing now tho i changed everything from "trigger" nothing above

nova karma
#

Then the game probably doesn’t recognize it

#

If you want to debug it, maybe it is good to turn on the debug log

wheat sparrow
#
Checking the Minecraft Logs

To see the logs (which provides information that helps you debug resourcepacks and datapacks), do this:

nova karma
#

You can also send your current version and maybe I can spot the error

nocturne patrol
#

okay

#

it seems like game sees these 2 advancements i made

#

but does absolutely nothing when i trying trigger it

#

second one works just fine

nova karma
#

Hm

#

Can you send it?

nocturne patrol
#

you mean code or more logs

nova karma
#

Th advancement

nocturne patrol
#
{
    "display": {
        "icon": {
            "item": "minecraft:cobblestone"
        },
        "title": "name",
        "description": "description"
    },
    "criteria": {
        "advancement": {
            "trigger": "minecraft:item_used_on_block",
            "conditions": {
                "item": {
                    "items": [
                        "minecraft:water_bucket"
                    ]
                }
            }
        }
    }
}
nova karma
#

Does it show up now ingame? Using the advancement command?

#

If not try this, it does not get any more bare bones

{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:item_used_on_block",
      "conditions": {
        "item": {
          "items": [
            "minecraft:water_bucket"
          ]
        }
      }
    }
  }
}
#

Although it should be the exact same, just without picture and stuff

nocturne patrol
#

no its not workin

nova karma
nocturne patrol
#

i'll check if preview code work, give me a sec

#

it works

nova karma
#

You can also just remove all criteria and check if placing a buckets triggers this advancement at all

#

Just remember to revoke it if you got it once before

nocturne patrol
nova karma
#
{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:item_used_on_block"
    }
  }
}
#

This ^^

nocturne patrol
#

Okay

#

no, spilling water didnt triggered anything

nova karma
#

👀

#

Does anything else trigger it now?

nocturne patrol
#

ye everything else

#

XD

nova karma
#

Okay, so we know where the problem is xDDD

#

Maybe try with placed_block?

nocturne patrol
#

with placed block it works

#

what about

#

i wanted to try it earlier but i had troubles implementing it

nova karma
#
{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:placed_block",
      "conditions": {
        "item": {
          "items": [
            "minecraft:water_bucket"
          ]
        }
      }
    }
  }
}

I'd try something like this

nocturne patrol
nova karma
#

The block/fluid check checks are for where you place it at

nova karma
nova karma
#

Just call them differently and add commas

nocturne patrol
#

hmm alright

nocturne patrol
nova karma
#

Like this

{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:placed_block",
      "conditions": {}
    },
    "jeigke": {
      "trigger": "minecraft:brewed_potion",
      "conditions": {}
    }
  }
}
nocturne patrol
#

oh this way

#

okay

#

it works

#

thanks so much for help

#

tho im still mad item used on block doesnt work with buckets

nova karma
nocturne patrol
#

now i still have to figure out how to connect this advancement to the root.json

#

so its one tab

nova karma
#

Just add the root advancement as a parent

#

And name it something not "root" itself

nocturne patrol
#

so i should copy whole code of this advancement to root file and set root as parent

nova karma
#

Okay nvm the root advancement does not have to have that name

nocturne patrol
#

i mean yeah but do i need to type new advancements in root and not in new file

#

if i want them in one category

nova karma
#

You should just be able to reference another advancement as a parent

#

And it should be in the same category

nocturne patrol
#

ughhh sorry for being such a bother but where the heck i put parent: here

nova karma
nocturne patrol
#
{
    "display": {
        "icon": {
            "item": "minecraft:dirt"
        },
        "title": {
            "text": "Skyblock",
            "color": "#fc03a1",
            "bold": true,
            "italic": true
        },
        "description": {
            "text": "Skyblock"
        },
        "frame": "task",
        "show_toast": true,
        "announce_to_chat": true,
        "hidden": false,
        "background": "minecraft:textures/block/obsidian.png"
    },
    "criteria": {
        "player_start": {
            "trigger": "minecraft:location",
            "conditions": {
                "player": {
                    "location": {
                        "position": {
                            "y": {
                                "max": -40,
                                "min": -50
                            }
                        }
                    }
                }
            }
        }
    },
    "rewards": {
        "experience": 10
    }
}
#

its my root.json

nova karma
nocturne patrol
#

so i put parent instead of criteria in root.json

nova karma
#
{
    "display": {
        "icon": {
            "item": "minecraft:dirt"
        },
        "title": {
            "text": "Skyblock",
            "color": "#fc03a1",
            "bold": true,
            "italic": true
        },
        "description": {
            "text": "Skyblock"
        },
        "frame": "task",
        "show_toast": true,
        "announce_to_chat": true,
        "hidden": false,
        "background": "minecraft:textures/block/obsidian.png"
    },
    "parent": "<namespace>:<my_parent_root_thing>",
    "criteria": {
        "player_start": {
            "trigger": "minecraft:location",
            "conditions": {
                "player": {
                    "location": {
                        "position": {
                            "y": {
                                "max": -40,
                                "min": -50
                            }
                        }
                    }
                }
            }
        }
    },
    "rewards": {
        "experience": 10
    }
}
nocturne patrol
#

oooh

#

okay thanks!

#

im done with datapacks for today

#

xd

nova karma
#

xD understandable

#

Have a great rest of your day

nocturne patrol
#

its night for me actually

#

tehee

nova karma
#

Same for me ^^

#

Then night :P