Advertisement
Guest User

Tarcza fix v2

a guest
Apr 3rd, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. command /tarcza2:
  2. trigger:
  3. give 1 of clay ball named "&bTarcza Obroncy" with lore "&5&lWytrzymalosc Przedmiotu: &2%100/100", "&dKliknij prawym aby zalozyc!" with nbt "{AttributeModifiers:[{AttributeName:""generic.armorToughness"",Amount:2,Operation:0,UUIDLeast:53576200,UUIDMost:99,Slot:offhand,Name:""generic.armorToughness""},{AttributeName:""generic.armor"",Amount:3,Operation:0,UUIDLeast:53576500,UUIDMost:96,Slot:offhand,Name:""generic.armor""}]}" to player
  4.  
  5. on rightclick:
  6. name of player's tool is "&bTarcza Obroncy":
  7. set {_temp} to player's offhand tool
  8. set player's offhand tool to player's tool
  9. set player's tool to {_temp}
  10. send "&bZalozyles tarcze!" to player
  11.  
  12. on damage of player:
  13. attacker is set
  14. name of victim's offhand tool is "&bTarcza Obroncy":
  15. set {_lore} to uncolored 1st line of victim's offhand tool's lore
  16. replace all "Wytrzymalosc Przedmiotu: " and "/100" with "" in {_lore}
  17. set {_lore} to {_lore} parsed as integer
  18. reduce {_lore} by 1
  19. if {_lore} is 0:
  20. set victim's offhand tool to air
  21. send "&4&l[!] &cTwoja tarcza ulegla zniszczeniu!" to victim
  22. play "ENTITY_ITEM_BREAK" to victim at volume 1
  23. stop
  24. else:
  25. if {_lore} is less than 5:
  26. set 1st line of victim's offhand tool's lore to "&5&lWytrzymalosc Przedmiotu: &2%{_lore}%/100"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement