1

@a selector not working in a written book command.

MooniPuss's Avatar MooniPuss8/30/23 4:20 pm
3/28/2024 3:35 pm
imalittlhigh's Avatar imalittlhigh
Hello guys,

These past days I've been making a datapack.

Just for some information about the pack: It's meant to be played on hardcore.

I made it so that the player receives a book when he spawns into the game for the first time. Everything works fine when I play on creative or survival but when I play on hardcore the selector wont register and it doesn't show the players name.

I really think it has something to do with the options to enable cheats. However I can't enable cheats in hardcore..

Does anyone know if there is a fix for this? or is it just not possible to use selectors in hardcore?

Any help would be appreciated
Posted by MooniPuss's Avatar
MooniPuss
Level 1 : New Miner
0

Create an account or sign in to comment.

13

1
09/04/2023 5:09 pm
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
heyo, i think i have found the issue:

Add the nbt "resolved:0b" to the written book, that should work
1
09/05/2023 5:10 pmhistory
Level 1 : New Miner
MooniPuss
MooniPuss's Avatar
hmm, doesn't seem to work..

I've written it like this now:

...{"text":" to see your progress)","color":"reset"}]'],title:"Quest for Daylight",author:MooniPuss,resolved:0b} (this is just the end part of my command)

Did I do anything wrong?
1
09/06/2023 5:58 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
idk honestly ^^
Just saw resolved and thought that might be the issue.

try this: give @p written_book{title:"",author:"";,resolved:0b,pages:';{";selector":"@p"}']} 1

and see if it works

if it doesnt then sry i cant help
1
08/31/2023 12:08 pm
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
You cant use commands in books and in tellraw. Klicking on that can only trigger things the player can (so trigger, etc) not actual commands.
Not sure if thats what your problem is tho ^^
Might be a problem with @a? try using @s if ur giving the book from an advancement trigger
1
08/31/2023 5:55 am
Level 36 : Artisan Droid
MaximusPrime23
MaximusPrime23's Avatar
Cheats don't work on hardcore, if you want it, disable respawn gamerule and place a texture pack to change the hearts, change difficulty to hard. And you have a perfect Hardcore with cheats.
1
08/31/2023 7:37 am
Level 1 : New Miner
MooniPuss
MooniPuss's Avatar
Thanks for the help. This would seem like a good solution, but I don't really find a command that disables respawning.. I found one that removes the death messages but that's not what I'm looking for..

can you maybe give more information on how to do this?
1
08/31/2023 8:15 am
Level 36 : Artisan Droid
MaximusPrime23
MaximusPrime23's Avatar
/ gamerule playerrespawn false, try this. Probably you can find a datapack that deactivates respawn.
1
08/30/2023 4:40 pm
Level 32 : Artisan Procrastinator
Spuduking
Spuduking's Avatar
How do you give the book to the player?
1
08/30/2023 5:06 pmhistory
Level 1 : New Miner
MooniPuss
MooniPuss's Avatar
with this command:


/give @p written_book{pages:['["",{"text":"\\n\\n"},{"text":"Make the most of the fleeting daylight; read this book after the first night falls.","italic":true}]','["",{"text":"Quest for Daylight","bold":true,"italic":true,"color":"dark_red"},{"text":"\\n\\nA realm that has weathered countless trials now faces an unparalleled epic.","color":"reset"}]','{"text":"Long ago, this world incurred divine wrath, a vengeful response to humanity\'s reckless and selfish ways.\\n\\nA devestating curse ensued, devouring the sun\'s brilliance and casting eternal night upon the land."}','{"text":"In protection of this malovent curse, five Lords of Darkness were summoned as stalwart gatekeepers, guarding the realm of daylight.\\n\\nBut behold, a prophecy speaks of a hero destined to emerge, a champion who shall defy all odds, slaying these-"}','{"text":"fiendish creatures and weaving a new sun from their very essence.\\n\\nOnly this chosen one can brave such a perilous quest and resurrect the world to its former glory."}','["",{"text":"Could this hero be you "},{"selector":"@a","bold":true,"italic":true,"color":"dark_green"},{"text":"?\\n\\n...\\n\\nYet, the ultimate test lies in whether humanity has truly learned from its past transgressions.","color":"reset"}]','{"text":"Gathering the mightiest wizards from across the realm, we have channeled our powers to bestow upon this hero one single day of sunlight.\\n\\nAny more.. Would have shattered us!"}','{"text":"Now, mighty hero, venture forth!\\n\\nThe destiny of the world rests in your hands, and the entire cosmos awaits your breathtaking feats of valor and heroism!"}','["",{"text":"But heed this warning:","italic":true,"color":"dark_red"},{"text":"\\n\\nYou have but 100 days to complete the challenge, or your legacy will fall short and the realm will be forever trapped in eternal darkness!\\n\\n(Press ","color":"reset"},{"keybind":"key.playerlist","bold":true,"italic":true,"color":"dark_green"},{"text":" to see what night you are on and ","color":"reset"},{"keybind":"key.advancements","bold":true,"italic":true,"color":"dark_green"},{"text":" to see your progress)","color":"reset"}]'],title:"Quest for Daylight",author:MooniPuss}

Its a bit long.. but yeah it has to include the story I want to tell to the player
1
08/30/2023 5:11 pm
Level 32 : Artisan Procrastinator
Spuduking
Spuduking's Avatar
I mean what triggers the give command?
1
08/30/2023 5:15 pm
Level 1 : New Miner
MooniPuss
MooniPuss's Avatar
oh! yes sorry Xp

I use 2 scoreboards that both start at 0 and when they get to 6 the book is given.

Command:execute as @a[scores={counter=6,welcome=6}] run function mooni:start/book
1
08/30/2023 7:14 pm
Level 32 : Artisan Procrastinator
Spuduking
Spuduking's Avatar
You may want to try an advancement such as this one:

{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:tick"
    }
  },
  "rewards": {
    "function": "mooni:start/book"
  }
}



what this does is it runs the book function immediately, but will only give it to a player once. It should work for multiple players too.
2
08/31/2023 5:10 am
Level 1 : New Miner
MooniPuss
MooniPuss's Avatar
this is definitely a better way to give the player the book instead of what I was using. However it still doesn't fix my issue.. I honestly just think its a *** bug on Minecraft's end.

If you have any other ideas, please let me know. But don't stress it, It's a minor detail in my pack.

but I appreciate the help a lot! u a nice guy :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome