Topic category: Help with Minecraft modding (Java Edition)
I want to use the button display conditions to hide a button in a GUI if the player doesn't have an advancement, and show when it does.
I thought it'd be simple, as I expected it to just be "Return: Has Event/target entity completed advancement (advancement)" or at most "Return: Has Event/target entity completed advancement (advancement) = true," but neither of these worked. It also didn't work when I did if the player had the advancement return true, but that doesn't work since the return block has to be the end, and if I just put a return false outside of the if block, it too does not work.
What would work then?
I am using the most recent snapshot, so it could possibly just be broken, but I could also just be missing something.
if Advancementcompleted "advancement"
do; Return true
Return false
this returns false regardless due to the return false having to be outside the if statement (and if its not supposed to do that it does either way)
Bump?
sorry, I'm rare online, this is the basic version of what you're looking for.
then on your button, go to Button Display Condition find the name of your procedure and apply it.
it's checks if the event/target entity (player) has completed the advancement, if the player has then it will return true (then display the button), if the player hasn't completed it, it moves down the hierarchy then returning false
I screwed up the last bit it should return false not true
I'm guessing that it's broken then, since it hides the button with and without the advancement. If I flip the true and false it shows regardless, which to I assume means it's reading the last one one regardless
Here is the best way to do that:
That's all!
It seems at the newer Versions of Minecraft (1.18+ I think) there no Getting Wood Advancement anymore.
Also make sure you choose the Procedure "is provided advancement equal to"!
Completely forgot about using variables, this worked, thanks !