Advertisement
L0v0lup

Skript-Reflect ✎ Eigene Achievements (1/2) #05 Tutorial

Jul 7th, 2023
1,363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.87 KB | None | 0 0
  1. import:
  2.     org.bukkit.event.inventory.InventoryClickEvent
  3.     org.bukkit.event.player.PlayerLoginEvent
  4.     org.bukkit.event.block.BlockBreakEvent 
  5.  
  6. options:
  7.     Slot_0_Head: "{SkullOwner:{Id:""ee81faf1-e1f2-49f6-a034-6148217ba388"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2YyZDM4ZWZhZTFlMGE1ODFmMjU4YWEwOWNhNjEwNzQ5ZDNlZmRkZjU4NjUzMDRmMmZhMThiN2ExYTBjM2JjZCJ9fX0=""}]}}}"
  8.     Slot_1_Head: "{SkullOwner:{Id:""ee81faf1-e1f2-49f6-a034-6148217ba388"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzVmMzcxYWNhYTQ5YWI5YmMxZmQ3ZmU5ZTVjOGIxYTM1MTUxYTZiN2ZhZTc5OGM3YTg0MTE3OWVlODU3YmRjZCJ9fX0=""}]}}}"
  9.  
  10. function Achievements(p: player):
  11.     open chest inventory with 6 rows named "&6Achievements" to {_p}
  12.     set {_UUID} to {_p}'s uuid
  13.  
  14.     set slot 0 of {_p}'s current inventory to player head with nbt compound from {@Slot_0_Head} named "&6Mining/Building"
  15.    
  16.     if {Achievements::1::%{_UUID}%::Tier} = 1:
  17.         set slot 1 of {_p}'s current inventory to player head with nbt compound from {@Slot_1_Head} named "&6Profi Miner 1" with lore "&fAufgabe: Farme 20 Stein", "", "&fFortschritt: %{Achievements::1::%{_UUID}%::Tier::Progress}%/20"
  18.     else if {Achievements::1::%{_UUID}%::Tier} = 2:
  19.         set slot 1 of {_p}'s current inventory to player head with nbt compound from {@Slot_1_Head} named "&6Profi Miner 2" with lore "&fAufgabe: Farme 500 Stein", "", "&fFortschritt: %{Achievements::1::%{_UUID}%::Tier::Progress}%/500"
  20.  
  21. command a:
  22.     trigger:
  23.         Achievements(player)
  24.  
  25. on InventoryClickEvent:
  26.  
  27.     set {_p} to event.getWhoClicked()
  28.     set {_slot} to event.getSlot()
  29.     set {_UUID} to {_p}.getUniqueId()
  30.     {_slot} != -999
  31.  
  32.     set {_invname} to event.getView().getTitle()
  33.     #event.getClickedInventory() != {_p}.getInventory()
  34.     {_invname} = "&6Achievements"
  35.     event.setCancelled(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement