hey guys i am trying to do a npc that sells a enchanted books and this is my code:
on inventory click:
event-inventory = (metadata tag "dorinv" of player):
cancel event
index of event-slot = 11:
if {money::%player's UUID%} is more than or equal to 10000:
remove 10000 from {money::%player's UUID%}
give player 1 enchanted book{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:4}]}
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 13:
if {money::%player's UUID%} is more than or equal to 12000:
remove 12000 from {money::%player's UUID%}
give player 1 enchanted book of protection 6 named "&dProtection VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 15:
if {money::%player's UUID%} is more than or equal to 14000:
remove 14000 from {money::%player's UUID%}
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
so when its give the enchatment book its doesnt work on anvil, someone can help?
[doublepost=1642614111,1642614050][/doublepost]ingore all the other staff in this code all i need is this:
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
its doesnt work on anvil how to fix it?
on inventory click:
event-inventory = (metadata tag "dorinv" of player):
cancel event
index of event-slot = 11:
if {money::%player's UUID%} is more than or equal to 10000:
remove 10000 from {money::%player's UUID%}
give player 1 enchanted book{StoredEnchantments:[{id:"minecraft:unbreaking",lvl:4}]}
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 13:
if {money::%player's UUID%} is more than or equal to 12000:
remove 12000 from {money::%player's UUID%}
give player 1 enchanted book of protection 6 named "&dProtection VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
index of event-slot = 15:
if {money::%player's UUID%} is more than or equal to 14000:
remove 14000 from {money::%player's UUID%}
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
play sound "entity.wandering_trader.trade" to player
else:
play sound "entity.wandering_trader.no" to player
send "&dדור: אין לך מספיק כסף!" to player
close player's inventory
so when its give the enchatment book its doesnt work on anvil, someone can help?
[doublepost=1642614111,1642614050][/doublepost]ingore all the other staff in this code all i need is this:
give player 1 enchanted book of efficiency 6 named "&dEfficiency VI" with lore "&dSpecial"
its doesnt work on anvil how to fix it?