Hello, I have a problem. I would like to write a buyer for items. I am almost finished, but there is one problem I can't get a handle on. Both items with and without NBT should be purchased.
Unfortunately, the function, despite being noted, does not differentiate whether the item has NBT data or not. For example: Stone is supposed to be purchased. The item has no NBT data. Nevertheless, it also accepts stones with NBT data.
Information for function: stone block, {}, 64, 40 , ZuRiLein:
What options do I have to prevent it from considering items with NBT data when the sought item has no NBT data?
greetings ZuRiKan
Unfortunately, the function, despite being noted, does not differentiate whether the item has NBT data or not. For example: Stone is supposed to be purchased. The item has no NBT data. Nevertheless, it also accepts stones with NBT data.
Information for function: stone block, {}, 64, 40 , ZuRiLein:
YAML:
function takeitem_l_n(i:item, n:text, m:number, c:number, p:player):
set {_item} to {_i}
set {_cost} to {_c}
set {_maxstack} to {_m}
if {_item} is not air:
if {_cost} > 0:
if {_p} has {_maxstack} of {_item} with custom nbt from "%{_n}%":
message "%{_item}% | %{_n}%" to {_p}
remove {_maxstack} of {_item} with custom nbt from "%{_n}%" from {_p}'s inventory
set {_money} to {_cost}
bungeemoneysend({ServerName},{_p},{_money})
else:
message formatted "<white><bold>[<orange><bold>INFO<white><bold>]<reset> <light red>Du hast nicht genügend Items" to {_p}
What options do I have to prevent it from considering items with NBT data when the sought item has no NBT data?
greetings ZuRiKan