#How To Make It So You Can't Get Stacks
1 messages · Page 1 of 1 (latest)
add a random nbt value to an item
what do u mean a random nbt value ?
add nbt
that nbt being a random number
ex {random:%random number between 0 and 10000%}
i think i fixed it but when i wish for an item it just gives/refund me back my wish token
do i still need the else:
send "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}
ik the issue is send "No item name provided. Here's your Wish Token back."
but idk how i would fix it
if {wish::%player's uuid%} is set:
if (message parsed as itemtype) is set:
if (message parsed as a number) is set:
send "You can't wish for stacks of items. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}
else:
if (message parsed as an item type) is set:
if (message parsed as a number) > 1:
send "Your wish has been granted! You received the requested item."
else:
if "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}```
i am trying to make the player wish for any item
yeah i get that
o
what im asking is how do you think skript is going to parse steak 1 as an example as both a number and an itemtype?
it wont be parsed as either bc its neither
for this youll probably have to split the message into a variable so that {_var::1} would be steak and {_var::2} would be 1
then parse those and see if its correct
do you get what im trying to say
kinda
do you know how to split strings
i don't think so
okay so youd do set x to split y at "z"
with those placeholders replaced with the actual values
set {_messageParts} to split message at " "
if {wish::%player's uuid%} is set:
if {_messageParts} is set:
if (the first item of {_messageParts} parsed as itemtype) is set:
if (the second item of {_messageParts} parsed as a number) is set:
send "You can't wish for stacks of items. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}
else if (the first item of {_messageParts} parsed as an item type) is set:
if (the second item of {_messageParts} parsed as a number) > 1:
send "Your wish has been granted! You received the requested item."
else:
send "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}```
like this ?
would i remove
send "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%} ```
Or would I leave it there ?
message parts variable needs to be a list variable.
you cant store multiple values in a variable that can only hold one value.
is this right and i am getting a error but i am guessing first item of, does not exist
set {_messageParts::*} to split message at " "
if {wish::%player's uuid%} is set:
if first item of {_messageParts::*} is set:
if (the first item of {_messageParts::*} parsed as item type) is set:
if (the second item of {_messageParts::*} is a number) is set:
send "You can't wish for stacks of items. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}
else if (the second item of {_messageParts::*} is a number) is set:
if (the second item of {_messageParts::*} > 1):
send "Your wish has been granted! You received the requested item."
else:
send "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}```
yeah you can specify what object in a list variable you are trying to access via {_var::1}, {_var::2} etc
like this ?
set {_messageParts::*} to split message at " "
if {wish::%player's uuid%} is set:
if {_messageParts::1} is set:
if ({_messageParts::1} parsed as item type) is set:
if {_messageParts::2} is a number:
send "You can't wish for stacks of items. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}
else if {_messageParts::2} is a number:
if {_messageParts::2} > 1:
send "Your wish has been granted! You received the requested item."
else:
send "No item name provided. Here's your Wish Token back."
give echo shard named "Wish Token" to player
delete {wish::%player's uuid%}```
I would put what you have on line 3, on line two instead, and indent the new line 3
and instead of checking a message on chat, why not just put that into a command? like command wish [<itemtype>]
the wish token / echo shard drops after you kill a player and then when u right click you enter the item name