Hello all, I am currently working on creating a massive monopoly board in Minecraft, and the only thing I have to do is create chance cards.
I want the skript to generate a random chance card, then give it to the player as a book, and this is my code so far:
command /chance:
trigger:
set {_chance::*} to "Advance to Boardwalk", "Advance to Go (Collect $200)", "Advance to Illinois Avenue. If you pass Go, collect $200", "Advance to St. Charles Place. If you pass Go, collect $200", "Advance to the nearest Railroad. If unowned, you may buy it from the Bank. If owned, pay wonder twice the rental to which they are otherwise entitled", "Advance to the nearest Railroad. If unowned, you may buy it from the Bank. If owned, pay wonder twice the rental to which they are otherwise entitled", "Advance token to nearest Utility. If unowned, you may buy it from the Bank. If owned, throw dice and pay owner a total ten times amount thrown.", "Bank pays you dividend of $50", "Get Out of Jail Free", "Go Back 3 Spaces", "Go to Jail. Go directly to Jail, do not pass Go, do not collect $200", "Make general repairs on all your property. For each house pay $25. For each hotel pay $100", "Speeding fine $15", "Take a trip to Reading Railroad. If you pass Go, collect $200", "You have been elected Chairman of the Board. Pay each player $50", "Your building loan matures. Collect $150"
set {_chancecard} to a random element out of {_chance::*}
set {_book} to a new written book
wait 1 tick
set {_component} to a new text component with text "&eYour chance card is: &6%{_chancecard}%"
add text component {_component} to book {_book}
give player {_book}
#open book {_book} to player
So this code when run, gives the player a book with hthe contents: *Invalid Book Tag*
How should i fix this?
I want the skript to generate a random chance card, then give it to the player as a book, and this is my code so far:
command /chance:
trigger:
set {_chance::*} to "Advance to Boardwalk", "Advance to Go (Collect $200)", "Advance to Illinois Avenue. If you pass Go, collect $200", "Advance to St. Charles Place. If you pass Go, collect $200", "Advance to the nearest Railroad. If unowned, you may buy it from the Bank. If owned, pay wonder twice the rental to which they are otherwise entitled", "Advance to the nearest Railroad. If unowned, you may buy it from the Bank. If owned, pay wonder twice the rental to which they are otherwise entitled", "Advance token to nearest Utility. If unowned, you may buy it from the Bank. If owned, throw dice and pay owner a total ten times amount thrown.", "Bank pays you dividend of $50", "Get Out of Jail Free", "Go Back 3 Spaces", "Go to Jail. Go directly to Jail, do not pass Go, do not collect $200", "Make general repairs on all your property. For each house pay $25. For each hotel pay $100", "Speeding fine $15", "Take a trip to Reading Railroad. If you pass Go, collect $200", "You have been elected Chairman of the Board. Pay each player $50", "Your building loan matures. Collect $150"
set {_chancecard} to a random element out of {_chance::*}
set {_book} to a new written book
wait 1 tick
set {_component} to a new text component with text "&eYour chance card is: &6%{_chancecard}%"
add text component {_component} to book {_book}
give player {_book}
#open book {_book} to player
So this code when run, gives the player a book with hthe contents: *Invalid Book Tag*
How should i fix this?