Minecraft – Custom Advancements and Functions 1.13.2

minecraft-commandsminecraft-data-packsminecraft-java-edition

I'm setting up a new server, and would like to have some custom Advancements.

I was thinking of using these as a way to start new players out with some basics…as they go through the spawn room, they would trigger Advancements that would run Functions to give them some items:

  • wooden axe
  • wooden pick
  • wooden sword
  • white bed
  • some food
  • leather armor…

Nothing ground shaking, but should allow for a slightly easier start.

I tried using the Advancements Generator here and using location ranges as the criteria, but they don't seem to be working.

Now I'm trying to use command blocks and pressure plates…but I can't get the correct commands to either grant the Advancement to the player stepping on the pressure plate…or the Function to gift the items to the player stepping on the pressure plate.

I've tried using the @p selector but that isn't working… give @p item amount

Have also tried execute as @s run give @p... but that isn't working either.

Do I have to somehow anchor the command to a location? I would have thought that the command block's location would be used by default…maybe it isn't though,

Thanks

Update:

If I run axe.mcfunction which has give @s wooden_axe 1…it works from chat

However, some of the functions aren't being recognized, and that is obviously the issue…like

give @s leatherhelmet 1 28 {display:{color:1476153,Name:Newb},ench:[{id:0,lvl:1},{id:3,lvl:1},{id:4,lvl:1}]}

…even when run in chat returns an error of Error: Player not found. It only works when I type in the actual username…no variables are working…@s, @p, @a won't work…

Update 2

After playing around some more…

/give @s leatherhelmet 1 28 {display: {Name: "Newb", color: 1476153}}

works with the playername…every time…still doesn't work with the variable.

Update 3

I now have the Advancements being granted correctly…and most of the functions to give items…the only one that isn't working is the one to give colored armor…

I got the command blocks to give the items by using execute as @p run function ... and the functions use give @p item count

Best Answer

According to the error messages, it seemed that you are using Essentials? If you are not, the following will not ever be correct.

Use minecraft:give instead of give, since Essentials give command does not recognize selectors.