/execute @e[type=Villager,name=Eric] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=1] ~ ~ ~ /give @p written_book 1 0 {pages:["[\"\",{\"text\":\"Eric \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"[Head Attendant]\\n\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"[1/4]\",\"color\":\"gray\"},{\"text\":\" Oh hello, you must be the new treasure hunter.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[2/4]\",\"color\":\"gray\"},{\"text\":\" I'm Eric, your attendee, report to me if you need anything.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[3/4]\",\"color\":\"gray\"},{\"text\":\" You should go talk to Mary, she's probably in a cave outside, follow the trail of flowers.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[4/4]\",\"color\":\"gray\"},{\"text\":\" Mary will explain your mission. Bye!\",\"color\":\"dark_purple\"}]"],title:"Right-Click to Talk",author:"Eric Ahstram"}
/execute @e[type=Villager,name=Mary] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=2] ~ ~ ~ /give @p written_book 1 0 {pages:["[\"\",{\"text\":\"Mary \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"[Head Artifact Treasurer]\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n[1/7] \",\"color\":\"gray\"},{\"text\":\"It's you! I've been waiting for you. Lets get right to it.\\n\",\"color\":\"light_purple\"},{\"text\":\"[2/7] \",\"color\":\"gray\"},{\"text\":\"Your mission is to collect the 7 trophies of Anstagrah.\\n\",\"color\":\"light_purple\"},{\"text\":\"[3/7] \",\"color\":\"gray\"},{\"text\":\"We already have two so you will have to search only 5, and you should already know that this mission is highly illegal.\",\"color\":\"light_purple\"}]","[\"\",{\"text\":\"[4/7] \",\"color\":\"gray\"},{\"text\":\"We need these trophies to activate the altar. We are not sure what will happen when we activate it. That's why it's illegal. It could blow up the planet!!\\n\",\"color\":\"light_purple\"},{\"text\":\"[5/7] \",\"color\":\"gray\"},{\"text\":\"You we're picked because of your bloodline, the altar says it can only be activated \\\"of those of our hands\\\".\\n\",\"color\":\"light_purple\"}]","[\"\",{\"text\":\"[6/7] \",\"color\":\"gray\"},{\"text\":\"But... Bad news, I hid the 2 trophies to make sure robbers couldn't find them.\\n\",\"color\":\"light_purple\"},{\"text\":\"[7/7] \",\"color\":\"gray\"},{\"text\":\"Find them, and bring back [Prismarine Crystals] and [Allium]. I do remeber that I may have put one of them in the attic... The other somewhere... Gross?\",\"color\":\"light_purple\"}]"],title:"Right-click to talk",author:"Mary Tarry"}
/replaceitem entity @a[score_gameStage_min=1] slot.hotbar.8 written_book 1 0 {pages:["[\"\",{\"text\":\"Stage \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"1\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n\",\"color\":\"none\"},{\"text\":\"Go talk to \",\"color\":\"dark_purple\"},{\"text\":\"Eric [at -16 46 -17]\",\"color\":\"light_purple\"}]"],title:"Quest/Guide Book",author:"Nobody in particular"}
/replaceitem entity @a[score_gameStage_min=2] slot.hotbar.8 written_book 1 0 {pages:["[\"\",{\"text\":\"Stage \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"2\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n\",\"color\":\"none\"},{\"text\":\"Go talk to \",\"color\":\"dark_purple\"},{\"text\":\"Mary [by following the trail of flowers]\",\"color\":\"light_purple\"}]"],title:"Quest/Guide Book",author:"Nobody in particular"}
UNDER VILLAGER [there is an emerald block under the villager. under that there is a command block ]:
Put the name before the type=Villager or remove Type=Villager entirely. That's my input
That...doesn't matter.
What I would try and do, is maybe increading the gameStage store for Mary to 3. What's happening is that because Eric and Mary are so close together, both of those conditions are being met.
It's finding Eric and Mary, because it matches. Then because the player meets both of those requirements (as they are identical), it activates both, as you are setting the score for gameStage to 2 before they talk to Mary:
Then it automatically activates the next, which gives the book. Increase the getting book check to gameStage=3.
Another thought could be the way the command blocks are set up. Try moving scoreboard players reset * talkedToVillager to the beginning of the line.
Also, try scoreboard players set @a talkedToVillager 0. It could be taking some time to reset all of those scores, which may also explain the delay, and getting two books.
You could also try tagging the player, and use tags instead.
Lots of possible things could be happening, so let us know!
I have two villagers if you right-click one of them it gives you give you one dialogue book. But for me it gives you 2.
/execute @e[type=Villager,name=Eric] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=1] ~ ~ ~ [gives book]
^^^
The other command is:
/execute @e[type=Villager,name=Mary] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=2] ~ ~ ~ [gives book]
But it still activates them both when I right click on ONLY one of them.
I've tried quotations ("") but that dosen't work either.
Click here to see all of my commands:
FIRST LINE [Villager right-click activator thing]:
/scoreboard objectives add talkedToVillager stat.talkedToVillager
/execute @e[type=Villager,name=Eric] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=1] ~ ~ ~ /give @p written_book 1 0 {pages:["[\"\",{\"text\":\"Eric \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"[Head Attendant]\\n\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"[1/4]\",\"color\":\"gray\"},{\"text\":\" Oh hello, you must be the new treasure hunter.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[2/4]\",\"color\":\"gray\"},{\"text\":\" I'm Eric, your attendee, report to me if you need anything.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[3/4]\",\"color\":\"gray\"},{\"text\":\" You should go talk to Mary, she's probably in a cave outside, follow the trail of flowers.\\n\",\"color\":\"dark_purple\"},{\"text\":\"[4/4]\",\"color\":\"gray\"},{\"text\":\" Mary will explain your mission. Bye!\",\"color\":\"dark_purple\"}]"],title:"Right-Click to Talk",author:"Eric Ahstram"}
/execute @e[type=Villager,name=Eric] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=1] ~ ~ ~ /scoreboard players set @p gameStage 2
/execute @e[type=Villager,name=Mary] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=2] ~ ~ ~ /give @p written_book 1 0 {pages:["[\"\",{\"text\":\"Mary \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"[Head Artifact Treasurer]\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n[1/7] \",\"color\":\"gray\"},{\"text\":\"It's you! I've been waiting for you. Lets get right to it.\\n\",\"color\":\"light_purple\"},{\"text\":\"[2/7] \",\"color\":\"gray\"},{\"text\":\"Your mission is to collect the 7 trophies of Anstagrah.\\n\",\"color\":\"light_purple\"},{\"text\":\"[3/7] \",\"color\":\"gray\"},{\"text\":\"We already have two so you will have to search only 5, and you should already know that this mission is highly illegal.\",\"color\":\"light_purple\"}]","[\"\",{\"text\":\"[4/7] \",\"color\":\"gray\"},{\"text\":\"We need these trophies to activate the altar. We are not sure what will happen when we activate it. That's why it's illegal. It could blow up the planet!!\\n\",\"color\":\"light_purple\"},{\"text\":\"[5/7] \",\"color\":\"gray\"},{\"text\":\"You we're picked because of your bloodline, the altar says it can only be activated \\\"of those of our hands\\\".\\n\",\"color\":\"light_purple\"}]","[\"\",{\"text\":\"[6/7] \",\"color\":\"gray\"},{\"text\":\"But... Bad news, I hid the 2 trophies to make sure robbers couldn't find them.\\n\",\"color\":\"light_purple\"},{\"text\":\"[7/7] \",\"color\":\"gray\"},{\"text\":\"Find them, and bring back [Prismarine Crystals] and [Allium]. I do remeber that I may have put one of them in the attic... The other somewhere... Gross?\",\"color\":\"light_purple\"}]"],title:"Right-click to talk",author:"Mary Tarry"}
/execute @e[type=Villager,name=Mary] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=2] ~ ~ ~ /scoreboard players set @p gameStage 3
/scoreboard players reset * talkedToVillager
SECOND LINE [Book removal line]:
/scoreboard objectives add clearBook stat.useItem.minecraft.written_book dummy
execute @a[score_clearBook_min=1] ~ ~ ~ clear @a written_book
/scoreboard players reset * clearBook
THIRD LINE [Game stages + Quest book]:
scoreboard objectives add gameStage dummy
/replaceitem entity @a[score_gameStage_min=1] slot.hotbar.8 written_book 1 0 {pages:["[\"\",{\"text\":\"Stage \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"1\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n\",\"color\":\"none\"},{\"text\":\"Go talk to \",\"color\":\"dark_purple\"},{\"text\":\"Eric [at -16 46 -17]\",\"color\":\"light_purple\"}]"],title:"Quest/Guide Book",author:"Nobody in particular"}
/replaceitem entity @a[score_gameStage_min=2] slot.hotbar.8 written_book 1 0 {pages:["[\"\",{\"text\":\"Stage \",\"color\":\"dark_purple\",\"bold\":true},{\"text\":\"2\",\"color\":\"light_purple\",\"bold\":false},{\"text\":\"\\n\",\"color\":\"none\"},{\"text\":\"Go talk to \",\"color\":\"dark_purple\"},{\"text\":\"Mary [by following the trail of flowers]\",\"color\":\"light_purple\"}]"],title:"Quest/Guide Book",author:"Nobody in particular"}
UNDER VILLAGER [there is an emerald block under the villager. under that there is a command block ]:
/summon Villager ~ ~1.5 ~ {Offers:{Recipes:[]},NoAI:1b,Invulnerable:1b,Silent:1b,Motion:[0.0d,0.0d,0.0d],CustomName:"Eric",CustomNameVisible:1b,}
/summon Villager ~ ~1.5 ~ {Offers:{Recipes:[]},NoAI:1b,Invulnerable:1b,Silent:1b,Motion:[0.0d,0.0d,0.0d],CustomName:"Mary",CustomNameVisible:1b,}
Everything in the spoiler works fine. Except the Villager detection part can someone help me?
-~Reefive
try putting your commands into somthing like dis:
or this:
or this:
YouTube: https://www.youtube.com/channel/UCzGDRYWcrGreMmQFo_d5N5Q
Facebook:https://goo.gl/s0r12d
Website:https://theusaf.weebly.com
JavaScript Projects: https://theusaf.github.io
Link Shortener: https://shortr.github.io
Twitter:https://www.twitter.com/theusafyt
Put the name before the type=Villager or remove Type=Villager entirely. That's my input
My Name Is Bhexion and I make datapacks.
Find me on PlanetMinecraft and Youtube.
That...doesn't matter.
What I would try and do, is maybe increading the gameStage store for Mary to 3. What's happening is that because Eric and Mary are so close together, both of those conditions are being met.
It's finding Eric and Mary, because it matches. Then because the player meets both of those requirements (as they are identical), it activates both, as you are setting the score for gameStage to 2 before they talk to Mary:
/execute @e[type=Villager,name=Eric] ~ ~ ~ /execute @a[score_talkedToVillager_min=1,score_gameStage_min=1] ~ ~ ~ /scoreboard players set @p gameStage 2
Then it automatically activates the next, which gives the book. Increase the getting book check to gameStage=3.
Another thought could be the way the command blocks are set up. Try moving scoreboard players reset * talkedToVillager to the beginning of the line.
Also, try scoreboard players set @a talkedToVillager 0. It could be taking some time to reset all of those scores, which may also explain the delay, and getting two books.
You could also try tagging the player, and use tags instead.
Lots of possible things could be happening, so let us know!