Çözüldü Skript ile NBT

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

_DarkSavic_

Odunlara Vur Vur Vur!
Katılım
21 Nisan 2022
Mesajlar
39
Elmaslar
2
Puan
6.260
Konum
Kayıp Şehir
Minecraft
_DarkSavic_

Discord:

darksavic

İyi akşamlar, skript ile şöyle bir şey yapmak istiyordum "<#FF0000>Kılıç &e1" isminde bir kılıç var bunu skript'imde oyuncuya verdiriyorum ancak bu kılıca NBT tagları eklemek istiyorum. Örneğin kılıca HideFlags, Unbreakable eklemek istiyorum. Ayrıca lore(açıklama) eklemek istiyorum. Bu kılıca bu az önce belirttiklerimi eklemek için çokça araştırma yaptım fakat bir sonuca varamadım.

Bu kılıcın NBT'sinde yer almasını istediklerim:

"HideFlag"ın 7 olması gerekiyor. 7 değeri altta belirttiklerimin gizlenmesini sağlıyor.
- Enchantments
- Attribute Modifiers
- Unbreakable
Bunları gizliyor.

"Unbreakable" = "1b" değerini alması gerekiyor.

Lore bölümüne de:

"&7Keskinlik 1"
""
"&7Satın almak için &6280 XP'ye &7ihtiyacın var."

İşe yarar mı bilmem ama NBT Editor ile kılıcın NBT'sini çıkarttım o da bu şekilde:
{Damage:0,Enchantments:[{id:"minecraft:sharpness",lvl:1s}],HideFlags:7,Unbreakable:1b,display:{Lore:['{"text":"","extra":[{"text":"Keskinlik 1","italic":false,"color":"gray"}]}','""','{"text":"","extra":[{"text":"Satın almak için ","italic":false,"color":"gray"},{"text":"280 XP\'ye ","italic":false,"color":"gold"},{"text":"ihtiyacın var.","italic":false,"color":"gray"}]}'],Name:'{"text":"","extra":[{"text":"Kılıç ","italic":false,"color":"#FF0000"},{"text":"1","italic":false,"color":"yellow"}]}'}}

Bunları yapmak istiyorum fakat başarısız oldum, lütfen birisi yardımcı olabilir mi?
 
Moderatör tarafından düzenlendi:
Bu işe skript ile girmye çalışmayın bence. Çünkü bu durumda NBT desteği çok kısıtlı. Ek olarak da sunucunuzu yorar bu şekilde 5-10 adet kılıç eklerseniz. MMOitems ve ItemEdit pluginlerini kullanabilirsiniz. Bu tür bir kılıç için skript önermem.
 
Bu işe skript ile girmye çalışmayın bence. Çünkü bu durumda NBT desteği çok kısıtlı. Ek olarak da sunucunuzu yorar bu şekilde 5-10 adet kılıç eklerseniz. MMOitems ve ItemEdit pluginlerini kullanabilirsiniz. Bu tür bir kılıç için skript önermem.
Şöyle ki Skript kullanma isteğimdeki gerekçe sunucumda eşya yükseltmeli bir sistem kurmaya çalışıyorum. Yazdığım Skript ile şuanda örn. 1. kılıçtan 2. kılıca geçmek için 1. kılıca ihtiyacın oluyor. Oyuncuya kılıçları verdirtiyorum çalışma mantığı da envanterde ismi "Kılıç 1" ise o eşyayı sildirip yeni bir kılıç verdiriyorum ismini "Kılıç 2" yaptırıp ismine sahip olan büyüyü bastırıyorum birden fazla olsa bile sadece tek kılıca gerekli büyüyü bastırıyorum. Kalan şeyler dediğim gibi Unbreakable, Hideflags ve Lore bunları eklemem gerekiyor. ItemEdit'in komutlarına henüz baktım. Siz söyleyince biraz mantıklı geldi şöyle düşündüm üstteki sistem gibi oyuncudaki eşya ismi "Kılıç 1" olsun bu isime sahip kılıca belirttiğim NBT Tag'larını eklesin gibi bir sistem düşündüm fakat ItemEdit'te böyle bir sistem yok gibi oyuncunun elindeki her hangi bir eşyayı modifiye edemiyoruz. Direkt oyuncu ile temasa geçebileceğimiz bir komutta bulunmuyor. MMOItems'e de gelirsek plugin ücretli olduğu için pluginin yüzüne bile bakmadım bunu ücretsiz şekilde çözebileceğim bir yol arıyorum. Bu yüzden Skript ile yapılabilirse Skripti tercih edeceğim.

Skript ve NBT ile ilgili örnek kodlarınız varsa iletirseniz sevinirim.
 
Şöyle ki Skript kullanma isteğimdeki gerekçe sunucumda eşya yükseltmeli bir sistem kurmaya çalışıyorum. Yazdığım Skript ile şuanda örn. 1. kılıçtan 2. kılıca geçmek için 1. kılıca ihtiyacın oluyor. Oyuncuya kılıçları verdirtiyorum çalışma mantığı da envanterde ismi "Kılıç 1" ise o eşyayı sildirip yeni bir kılıç verdiriyorum ismini "Kılıç 2" yaptırıp ismine sahip olan büyüyü bastırıyorum birden fazla olsa bile sadece tek kılıca gerekli büyüyü bastırıyorum. Kalan şeyler dediğim gibi Unbreakable, Hideflags ve Lore bunları eklemem gerekiyor. ItemEdit'in komutlarına henüz baktım. Siz söyleyince biraz mantıklı geldi şöyle düşündüm üstteki sistem gibi oyuncudaki eşya ismi "Kılıç 1" olsun bu isime sahip kılıca belirttiğim NBT Tag'larını eklesin gibi bir sistem düşündüm fakat ItemEdit'te böyle bir sistem yok gibi oyuncunun elindeki her hangi bir eşyayı modifiye edemiyoruz. Direkt oyuncu ile temasa geçebileceğimiz bir komutta bulunmuyor. MMOItems'e de gelirsek plugin ücretli olduğu için pluginin yüzüne bile bakmadım bunu ücretsiz şekilde çözebileceğim bir yol arıyorum. Bu yüzden Skript ile yapılabilirse Skripti tercih edeceğim.

Skript ve NBT ile ilgili örnek kodlarınız varsa iletirseniz sevinirim.
En basit yolu PlayerKits ile gizli bir kit oluşturmak. Eski kılıcı silip kit komuduyla oyuncuya verirsin. Komutu da sadece konsoldan kullanılmaya açarsın.
 
En basit yolu PlayerKits ile gizli bir kit oluşturmak. Eski kılıcı silip kit komuduyla oyuncuya verirsin. Komutu da sadece konsoldan kullanılmaya açarsın.
Bunu da deneyebilirim aslında bir köşede kalsın güzel bir fikir teşekkür ederim. Ancak bunu direkt Skript ile yapabilirsem daha iyi olacağını düşünüyorum.
 
İyi akşamlar, skript ile şöyle bir şey yapmak istiyordum "<#FF0000>Kılıç &e1" isminde bir kılıç var bunu skript'imde oyuncuya verdiriyorum ancak bu kılıca NBT tagları eklemek istiyorum. Örneğin kılıca HideFlags, Unbreakable eklemek istiyorum. Ayrıca lore(açıklama) eklemek istiyorum. Bu kılıca bu az önce belirttiklerimi eklemek için çokça araştırma yaptım fakat bir sonuca varamadım.

Bu kılıcın NBT'sinde yer almasını istediklerim:

"HideFlag"ın 7 olması gerekiyor. 7 değeri altta belirttiklerimin gizlenmesini sağlıyor.
- Enchantments
- Attribute Modifiers
- Unbreakable
Bunları gizliyor.

"Unbreakable" = "1b" değerini alması gerekiyor.

Lore bölümüne de:



Bunları yapmak istiyorum fakat başarısız oldum, lütfen birisi yardımcı olabilir mi?
Senin için tutorial tarzında ve istediğin şeye yakın bir skript hazırladım kendine göre buna bakarak düzenleyebilirsin. Sadece skbee addonu yeterli:

JavaScript:
# Custom Sword with NBT Tags using SkBee
# Author: Furkqn
# Description: Creates a custom sword with HideFlags, Unbreakable, and custom lore

command /customsword:
    permission: server.admin
    trigger:
        # Ana kılıcı oluştur
        set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
        
        # Lore ekle
        set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
        
        # Enchantment ekle (Keskinlik 1)
        enchant {_sword} with sharpness 1
        
        # Item flags ekle (enchantment, attribute ve unbreakable gizle)
        add hide enchants to item flags of {_sword}
        add hide attributes to item flags of {_sword}
        add hide unbreakable to item flags of {_sword}
        
        # Unbreakable NBT ekle
        set {_nbt} to nbt compound of {_sword}
        set byte tag "Unbreakable" of {_nbt} to 1
        
        # Oyuncuya ver
        give {_sword} to player
        send "&aCustom kılıç başarıyla verildi!" to player

# Alternatif yöntem - Daha basit syntax
command /customsword2:
    permission: server.admin
    trigger:
        # Ana kılıcı oluştur
        set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
        
        # Lore ve enchantment
        set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
        enchant {_sword} with sharpness 1
        
        # Tüm gizleme flag'lerini ekle
        set item flags of {_sword} to all item flags
        
        # Unbreakable yap
        set {_nbt} to nbt compound of {_sword}
        set byte tag "Unbreakable" of {_nbt} to 1
        
        # Oyuncuya ver
        give {_sword} to player
        send "&aCustom kılıç (Basit Yöntem) başarıyla verildi!" to player

# Fonksiyon olarak kullanım
function createCustomSword() :: item:
    set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
    
    # Lore ve enchantment
    set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
    enchant {_sword} with sharpness 1
    
    # Item flags ekle
    add hide enchants to item flags of {_sword}
    add hide attributes to item flags of {_sword}
    add hide unbreakable to item flags of {_sword}
    
    # Unbreakable NBT
    set {_nbt} to nbt compound of {_sword}
    set byte tag "Unbreakable" of {_nbt} to 1
    
    return {_sword}

# Fonksiyonu kullanma örneği
command /givecustomsword <player>:
    permission: server.admin
    trigger:
        set {_customSword} to createCustomSword()
        give {_customSword} to arg-1
        send "&a%arg-1% oyuncusuna custom kılıç verildi!" to player

# Shop sistemi ile entegrasyon örneği
command /buysword:
    trigger:
        if player's level >= 280:
            set {_sword} to createCustomSword()
            
            # Eğer envanterde yer yoksa XP kesme
            if player can hold {_sword}:
                remove 280 from player's level
                give {_sword} to player
                send "&aKılıç satın alındı! 280 XP harcandı." to player
            else:
                send "&cEnvanterinizde yer yok!" to player
        else:
            send "&cYeterli XP'niz yok! 280 XP'ye ihtiyacınız var." to player

# NBT kontrolü yapma örneği
on right click:
    if player's tool is iron sword:
        set {_nbt} to nbt compound of player's tool
        if byte tag "Unbreakable" of {_nbt} is 1:
            send "&aBu kılıç kırılmaz!" to player
        if int tag "HideFlags" of {_nbt} >= 1:
            send "&aBu kılıçta gizli özellikler var!" to player

#! EŞYA YÜKSELTME SİSTEMİ !#

# Oyuncunun elindeki eşyayı modifiye etme fonksiyonu
function modifyPlayerItem(p: player, oldName: string, newName: string, enchantLevel: number, newLore: strings):
    # Oyuncunun elinde kılıç var mı kontrol et
    if {_p}'s tool is air:
        send "&cElinizde bir kılıç tutmalısınız!" to {_p}
        stop
    if {_p}'s tool is not a sword:
        send "&cElinizde bir kılıç tutmalısınız!" to {_p}
        stop
    
    # Elindeki kılıcın ismi doğru mu kontrol et
    if name of {_p}'s tool is not {_oldName}:
        send "&cElinizde %{_oldName}% tutmuyorsunuz!" to {_p}
        send "&7Şu anda elinizde: %name of {_p}'s tool%" to {_p}
        stop
    
    # Elindeki kılıcı modifiye et
    set {_item} to {_p}'s tool
    
    # Yeni isim ver
    set name of {_item} to {_newName}
    
    # Yeni lore ekle
    set lore of {_item} to {_newLore::*}
    
    # Enchantment seviyesini güncelle
    set enchantment level of sharpness of {_item} to {_enchantLevel}
    
    # NBT modifikasyonları
    set {_nbt} to nbt compound of {_item}
    set byte tag "Unbreakable" of {_nbt} to 1
    
    # Item flags ekle
    add hide enchants to item flags of {_item}
    add hide attributes to item flags of {_item}
    add hide unbreakable to item flags of {_item}
    
    # Güncellenmiş eşyayı oyuncunun eline ver
    set {_p}'s tool to {_item}
    
    send "&a%{_oldName}% → %{_newName}% yükseltildi!" to {_p}

# Kılıç yükseltme komutları
command /upgrade1to2:
    trigger:
        set {_lore::*} to "&7Keskinlik 2", "", "&7Satın almak için &6500 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e1", "<#FF0000>Kılıç &e2", 2, {_lore::*})

command /upgrade2to3:
    trigger:
        set {_lore::*} to "&7Keskinlik 3", "", "&7Satın almak için &6750 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e2", "<#FF0000>Kılıç &e3", 3, {_lore::*})

command /upgrade3to4:
    trigger:
        set {_lore::*} to "&7Keskinlik 4", "", "&7Satın almak için &61000 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e3", "<#FF0000>Kılıç &e4", 4, {_lore::*})

command /upgrade4to5:
    trigger:
        set {_lore::*} to "&7Keskinlik 5", "", "&7&lMAKSİMUM SEVİYE!"
        modifyPlayerItem(player, "<#FF0000>Kılıç &e4", "<#FF0000>Kılıç &e5", 5, {_lore::*})

# Dinamik yükseltme sistemi (daha gelişmiş)
command /upgradesword [<number>]:
    trigger:
        if arg-1 is not set:
            send "&cKullanım: /upgradesword <seviye>"
            send "&7Örnek: /upgradesword 2 (Kılıç 1'i Kılıç 2'ye yükseltir)"
            stop
        
        set {_targetLevel} to arg-1
        set {_currentLevel} to {_targetLevel} - 1
        
        if {_targetLevel} < 2 or {_targetLevel} > 5:
            send "&cGeçerli seviye: 2-5 arası!"
            stop
        
        set {_currentName} to "<#FF0000>Kılıç &e%{_currentLevel}%"
        set {_newName} to "<#FF0000>Kılıç &e%{_targetLevel}%"
        
        # Lore'u seviyeye göre ayarla
        if {_targetLevel} = 5:
            set {_lore::*} to "&7Keskinlik %{_targetLevel}%", "", "&7&lMAKSİMUM SEVİYE!"
        else:
            set {_cost} to {_targetLevel} * 250
            set {_lore::*} to "&7Keskinlik %{_targetLevel}%", "", "&7Satın almak için &6%{_cost}% XP'ye &7ihtiyacın var."
        
        modifyPlayerItem(player, {_currentName}, {_newName}, {_targetLevel}, {_lore::*})

# Eşya kontrol sistemi
command /checksword:
    trigger:
        if player's tool is not a sword:
            send "&cElinizde bir kılıç tutmalısınız!"
            stop
        
        set {_name} to name of player's tool
        set {_enchantLevel} to enchantment level of sharpness of player's tool
        set {_nbt} to nbt compound of player's tool
        set {_unbreakable} to byte tag "Unbreakable" of {_nbt}
        set {_hideFlags} to int tag "HideFlags" of {_nbt}
        
        send "&6═══ KILIÇ BİLGİLERİ ═══"
        send "&7İsim: %{_name}%"
        send "&7Keskinlik Seviyesi: &a%{_enchantLevel}%"
        
        if {_unbreakable} = 1:
            send "&7Kırılmaz: &aEvet"
        else:
            send "&7Kırılmaz: &cHayır"
        
        if {_hideFlags} >= 1:
            send "&7Gizli Özellikler: &aVar"
        else:
            send "&7Gizli Özellikler: &cYok"

# Tüm kılıçları listele
command /listswords:
    trigger:
        send "&6═══ ENVANTERİNİZDEKİ KILIÇLAR ═══"
        set {_found} to false
        loop all items in inventory of player:
            if loop-item is a sword:
                if name of loop-item contains "Kılıç":
                    set {_found} to true
                    set {_enchantLevel} to enchantment level of sharpness of loop-item
                    send "&7- %name of loop-item% &7(Keskinlik %{_enchantLevel}%)"
        
        if {_found} is false:
            send "&cEnvanterinizde özel kılıç bulunamadı!"

# Otomatik yükseltme sistemi (XP ile)
command /autoupgrade:
    trigger:
        # Kılıç 1'den başlayarak en yüksek seviyeye kadar yükselt
        loop integers from 1 to 4:
            set {_currentName} to "<#FF0000>Kılıç &e%loop-value%"
            set {_nextLevel} to loop-value + 1
            set {_cost} to {_nextLevel} * 250
            
            # Oyuncunun elinde doğru kılıç var mı kontrol et
            if player's tool is air:
                send "&cElinizde bir kılıç tutmalısınız!" to player
                stop
            if player's tool is not a sword:
                send "&cElinizde bir kılıç tutmalısınız!" to player
                stop
            
            if name of player's tool is {_currentName}:
                # XP kontrolü - XP yeterliyse yükselt
                if player's level >= {_cost}:
                    # XP'yi kaldır
                    remove {_cost} from player's level
                    
                    # Yeni isim ve lore ayarla
                    set {_newName} to "<#FF0000>Kılıç &e%{_nextLevel}%"
                    
                    if {_nextLevel} = 5:
                        set {_lore::*} to "&7Keskinlik %{_nextLevel}%", "", "&7&lMAKSİMUM SEVİYE!"
                    else:
                        set {_nextCost} to ({_nextLevel} + 1) * 250
                        set {_lore::*} to "&7Keskinlik %{_nextLevel}%", "", "&7Satın almak için &6%{_nextCost}% XP'ye &7ihtiyacın var."
                    
                    # Kılıcı yükselt
                    modifyPlayerItem(player, {_currentName}, {_newName}, {_nextLevel}, {_lore::*})
                    stop
                else:
                    send "&c%{_currentName}% yükseltmek için %{_cost}% XP gerekli! (Mevcut: %player's level%)"
                    stop
        
        # Hiçbir yükseltilebilir kılıç bulunamazsa
        if player's tool is a sword:
            if name of player's tool contains "Kılıç":
                send "&7Elinizde yükseltilebilir bir kılıç yok veya zaten maksimum seviyede!"
            else:
                send "&cElinizde özel bir kılıç tutmuyorsunuz!"
 
Senin için tutorial tarzında ve istediğin şeye yakın bir skript hazırladım kendine göre buna bakarak düzenleyebilirsin. Sadece skbee addonu yeterli:

JavaScript:
# Custom Sword with NBT Tags using SkBee
# Author: Furkqn
# Description: Creates a custom sword with HideFlags, Unbreakable, and custom lore

command /customsword:
    permission: server.admin
    trigger:
        # Ana kılıcı oluştur
        set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
       
        # Lore ekle
        set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
       
        # Enchantment ekle (Keskinlik 1)
        enchant {_sword} with sharpness 1
       
        # Item flags ekle (enchantment, attribute ve unbreakable gizle)
        add hide enchants to item flags of {_sword}
        add hide attributes to item flags of {_sword}
        add hide unbreakable to item flags of {_sword}
       
        # Unbreakable NBT ekle
        set {_nbt} to nbt compound of {_sword}
        set byte tag "Unbreakable" of {_nbt} to 1
       
        # Oyuncuya ver
        give {_sword} to player
        send "&aCustom kılıç başarıyla verildi!" to player

# Alternatif yöntem - Daha basit syntax
command /customsword2:
    permission: server.admin
    trigger:
        # Ana kılıcı oluştur
        set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
       
        # Lore ve enchantment
        set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
        enchant {_sword} with sharpness 1
       
        # Tüm gizleme flag'lerini ekle
        set item flags of {_sword} to all item flags
       
        # Unbreakable yap
        set {_nbt} to nbt compound of {_sword}
        set byte tag "Unbreakable" of {_nbt} to 1
       
        # Oyuncuya ver
        give {_sword} to player
        send "&aCustom kılıç (Basit Yöntem) başarıyla verildi!" to player

# Fonksiyon olarak kullanım
function createCustomSword() :: item:
    set {_sword} to iron sword named "<#FF0000>Kılıç &e1"
   
    # Lore ve enchantment
    set lore of {_sword} to "&7Keskinlik 1", "", "&7Satın almak için &6280 XP'ye &7ihtiyacın var."
    enchant {_sword} with sharpness 1
   
    # Item flags ekle
    add hide enchants to item flags of {_sword}
    add hide attributes to item flags of {_sword}
    add hide unbreakable to item flags of {_sword}
   
    # Unbreakable NBT
    set {_nbt} to nbt compound of {_sword}
    set byte tag "Unbreakable" of {_nbt} to 1
   
    return {_sword}

# Fonksiyonu kullanma örneği
command /givecustomsword <player>:
    permission: server.admin
    trigger:
        set {_customSword} to createCustomSword()
        give {_customSword} to arg-1
        send "&a%arg-1% oyuncusuna custom kılıç verildi!" to player

# Shop sistemi ile entegrasyon örneği
command /buysword:
    trigger:
        if player's level >= 280:
            set {_sword} to createCustomSword()
           
            # Eğer envanterde yer yoksa XP kesme
            if player can hold {_sword}:
                remove 280 from player's level
                give {_sword} to player
                send "&aKılıç satın alındı! 280 XP harcandı." to player
            else:
                send "&cEnvanterinizde yer yok!" to player
        else:
            send "&cYeterli XP'niz yok! 280 XP'ye ihtiyacınız var." to player

# NBT kontrolü yapma örneği
on right click:
    if player's tool is iron sword:
        set {_nbt} to nbt compound of player's tool
        if byte tag "Unbreakable" of {_nbt} is 1:
            send "&aBu kılıç kırılmaz!" to player
        if int tag "HideFlags" of {_nbt} >= 1:
            send "&aBu kılıçta gizli özellikler var!" to player

#! EŞYA YÜKSELTME SİSTEMİ !#

# Oyuncunun elindeki eşyayı modifiye etme fonksiyonu
function modifyPlayerItem(p: player, oldName: string, newName: string, enchantLevel: number, newLore: strings):
    # Oyuncunun elinde kılıç var mı kontrol et
    if {_p}'s tool is air:
        send "&cElinizde bir kılıç tutmalısınız!" to {_p}
        stop
    if {_p}'s tool is not a sword:
        send "&cElinizde bir kılıç tutmalısınız!" to {_p}
        stop
   
    # Elindeki kılıcın ismi doğru mu kontrol et
    if name of {_p}'s tool is not {_oldName}:
        send "&cElinizde %{_oldName}% tutmuyorsunuz!" to {_p}
        send "&7Şu anda elinizde: %name of {_p}'s tool%" to {_p}
        stop
   
    # Elindeki kılıcı modifiye et
    set {_item} to {_p}'s tool
   
    # Yeni isim ver
    set name of {_item} to {_newName}
   
    # Yeni lore ekle
    set lore of {_item} to {_newLore::*}
   
    # Enchantment seviyesini güncelle
    set enchantment level of sharpness of {_item} to {_enchantLevel}
   
    # NBT modifikasyonları
    set {_nbt} to nbt compound of {_item}
    set byte tag "Unbreakable" of {_nbt} to 1
   
    # Item flags ekle
    add hide enchants to item flags of {_item}
    add hide attributes to item flags of {_item}
    add hide unbreakable to item flags of {_item}
   
    # Güncellenmiş eşyayı oyuncunun eline ver
    set {_p}'s tool to {_item}
   
    send "&a%{_oldName}% → %{_newName}% yükseltildi!" to {_p}

# Kılıç yükseltme komutları
command /upgrade1to2:
    trigger:
        set {_lore::*} to "&7Keskinlik 2", "", "&7Satın almak için &6500 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e1", "<#FF0000>Kılıç &e2", 2, {_lore::*})

command /upgrade2to3:
    trigger:
        set {_lore::*} to "&7Keskinlik 3", "", "&7Satın almak için &6750 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e2", "<#FF0000>Kılıç &e3", 3, {_lore::*})

command /upgrade3to4:
    trigger:
        set {_lore::*} to "&7Keskinlik 4", "", "&7Satın almak için &61000 XP'ye &7ihtiyacın var."
        modifyPlayerItem(player, "<#FF0000>Kılıç &e3", "<#FF0000>Kılıç &e4", 4, {_lore::*})

command /upgrade4to5:
    trigger:
        set {_lore::*} to "&7Keskinlik 5", "", "&7&lMAKSİMUM SEVİYE!"
        modifyPlayerItem(player, "<#FF0000>Kılıç &e4", "<#FF0000>Kılıç &e5", 5, {_lore::*})

# Dinamik yükseltme sistemi (daha gelişmiş)
command /upgradesword [<number>]:
    trigger:
        if arg-1 is not set:
            send "&cKullanım: /upgradesword <seviye>"
            send "&7Örnek: /upgradesword 2 (Kılıç 1'i Kılıç 2'ye yükseltir)"
            stop
       
        set {_targetLevel} to arg-1
        set {_currentLevel} to {_targetLevel} - 1
       
        if {_targetLevel} < 2 or {_targetLevel} > 5:
            send "&cGeçerli seviye: 2-5 arası!"
            stop
       
        set {_currentName} to "<#FF0000>Kılıç &e%{_currentLevel}%"
        set {_newName} to "<#FF0000>Kılıç &e%{_targetLevel}%"
       
        # Lore'u seviyeye göre ayarla
        if {_targetLevel} = 5:
            set {_lore::*} to "&7Keskinlik %{_targetLevel}%", "", "&7&lMAKSİMUM SEVİYE!"
        else:
            set {_cost} to {_targetLevel} * 250
            set {_lore::*} to "&7Keskinlik %{_targetLevel}%", "", "&7Satın almak için &6%{_cost}% XP'ye &7ihtiyacın var."
       
        modifyPlayerItem(player, {_currentName}, {_newName}, {_targetLevel}, {_lore::*})

# Eşya kontrol sistemi
command /checksword:
    trigger:
        if player's tool is not a sword:
            send "&cElinizde bir kılıç tutmalısınız!"
            stop
       
        set {_name} to name of player's tool
        set {_enchantLevel} to enchantment level of sharpness of player's tool
        set {_nbt} to nbt compound of player's tool
        set {_unbreakable} to byte tag "Unbreakable" of {_nbt}
        set {_hideFlags} to int tag "HideFlags" of {_nbt}
       
        send "&6═══ KILIÇ BİLGİLERİ ═══"
        send "&7İsim: %{_name}%"
        send "&7Keskinlik Seviyesi: &a%{_enchantLevel}%"
       
        if {_unbreakable} = 1:
            send "&7Kırılmaz: &aEvet"
        else:
            send "&7Kırılmaz: &cHayır"
       
        if {_hideFlags} >= 1:
            send "&7Gizli Özellikler: &aVar"
        else:
            send "&7Gizli Özellikler: &cYok"

# Tüm kılıçları listele
command /listswords:
    trigger:
        send "&6═══ ENVANTERİNİZDEKİ KILIÇLAR ═══"
        set {_found} to false
        loop all items in inventory of player:
            if loop-item is a sword:
                if name of loop-item contains "Kılıç":
                    set {_found} to true
                    set {_enchantLevel} to enchantment level of sharpness of loop-item
                    send "&7- %name of loop-item% &7(Keskinlik %{_enchantLevel}%)"
       
        if {_found} is false:
            send "&cEnvanterinizde özel kılıç bulunamadı!"

# Otomatik yükseltme sistemi (XP ile)
command /autoupgrade:
    trigger:
        # Kılıç 1'den başlayarak en yüksek seviyeye kadar yükselt
        loop integers from 1 to 4:
            set {_currentName} to "<#FF0000>Kılıç &e%loop-value%"
            set {_nextLevel} to loop-value + 1
            set {_cost} to {_nextLevel} * 250
           
            # Oyuncunun elinde doğru kılıç var mı kontrol et
            if player's tool is air:
                send "&cElinizde bir kılıç tutmalısınız!" to player
                stop
            if player's tool is not a sword:
                send "&cElinizde bir kılıç tutmalısınız!" to player
                stop
           
            if name of player's tool is {_currentName}:
                # XP kontrolü - XP yeterliyse yükselt
                if player's level >= {_cost}:
                    # XP'yi kaldır
                    remove {_cost} from player's level
                   
                    # Yeni isim ve lore ayarla
                    set {_newName} to "<#FF0000>Kılıç &e%{_nextLevel}%"
                   
                    if {_nextLevel} = 5:
                        set {_lore::*} to "&7Keskinlik %{_nextLevel}%", "", "&7&lMAKSİMUM SEVİYE!"
                    else:
                        set {_nextCost} to ({_nextLevel} + 1) * 250
                        set {_lore::*} to "&7Keskinlik %{_nextLevel}%", "", "&7Satın almak için &6%{_nextCost}% XP'ye &7ihtiyacın var."
                   
                    # Kılıcı yükselt
                    modifyPlayerItem(player, {_currentName}, {_newName}, {_nextLevel}, {_lore::*})
                    stop
                else:
                    send "&c%{_currentName}% yükseltmek için %{_cost}% XP gerekli! (Mevcut: %player's level%)"
                    stop
       
        # Hiçbir yükseltilebilir kılıç bulunamazsa
        if player's tool is a sword:
            if name of player's tool contains "Kılıç":
                send "&7Elinizde yükseltilebilir bir kılıç yok veya zaten maksimum seviyede!"
            else:
                send "&cElinizde özel bir kılıç tutmuyorsunuz!"
Elinize emeğinize sağlık, Skript'inizi düz olarak yeni bir .sk dosyasına yükledim ancak tonla sorun çıktı. Sizde sorunsuz mu çalışıyordu? Ona göre düzeltmeye çalışacağım.
 
Bu işe skript ile girmye çalışmayın bence. Çünkü bu durumda NBT desteği çok kısıtlı. Ek olarak da sunucunuzu yorar bu şekilde 5-10 adet kılıç eklerseniz. MMOitems ve ItemEdit pluginlerini kullanabilirsiniz. Bu tür bir kılıç için skript önermem.
nbt desteği kısıtlı falan değil... ayrıca sunucuyu da yormaz :/
Şöyle ki Skript kullanma isteğimdeki gerekçe sunucumda eşya yükseltmeli bir sistem kurmaya çalışıyorum. Yazdığım Skript ile şuanda örn. 1. kılıçtan 2. kılıca geçmek için 1. kılıca ihtiyacın oluyor. Oyuncuya kılıçları verdirtiyorum çalışma mantığı da envanterde ismi "Kılıç 1" ise o eşyayı sildirip yeni bir kılıç verdiriyorum ismini "Kılıç 2" yaptırıp ismine sahip olan büyüyü bastırıyorum birden fazla olsa bile sadece tek kılıca gerekli büyüyü bastırıyorum. Kalan şeyler dediğim gibi Unbreakable, Hideflags ve Lore bunları eklemem gerekiyor. ItemEdit'in komutlarına henüz baktım. Siz söyleyince biraz mantıklı geldi şöyle düşündüm üstteki sistem gibi oyuncudaki eşya ismi "Kılıç 1" olsun bu isime sahip kılıca belirttiğim NBT Tag'larını eklesin gibi bir sistem düşündüm fakat ItemEdit'te böyle bir sistem yok gibi oyuncunun elindeki her hangi bir eşyayı modifiye edemiyoruz. Direkt oyuncu ile temasa geçebileceğimiz bir komutta bulunmuyor. MMOItems'e de gelirsek plugin ücretli olduğu için pluginin yüzüne bile bakmadım bunu ücretsiz şekilde çözebileceğim bir yol arıyorum. Bu yüzden Skript ile yapılabilirse Skripti tercih edeceğim.

Skript ve NBT ile ilgili örnek kodlarınız varsa iletirseniz sevinirim.

daha önce ShopKeeper tarzı bir skript yapmıştım, bu skript custom marketler oluşturup her öğeye özel gereksinimler tanımlamayı sağlıyor ancak yeni sürümlerde nasıl çalışır bilmiyorum... Sk-gui, Skbee ve Sk 2.8+ gerekiyor (yani 1.20.4 için böyleydi...). bu skripti eklentimi geliştirmek için yapmıştım.. basit bir prototip. yani 30dk da yapılan bir skript ne kadar güvenilir olur bilmiyorum ancak sorun çıkartacağını da sanmam :') bunu eklenti olarak geliştirmemin sebebi ise skript'in çok saçma bir karşılaştırma bug'una sahip olması... belki yeni sürümlerde bu sorun çözülmüştür.

video:


GUI:
Kod:
#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#

function guiShopsManager(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    create gui with virtual chest inventory with 6 rows named "@Editör [%{_type} ? "&4&lERROR"%&r]" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
    
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
        
        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
            cancel event
            
        edit gui last gui:
        
            {_type} is "@anemys":
                set {_items::*} to getShops() if {shops::created::*} is set
                
            else:
                getShops() contains {_type}:
                    set {_items::*} to getShopItems({_type})

                    make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
                        eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
                        open guiShopsManager({_p}, "@anemys", {_item}) for {_p}
                
                    make gui slot "N" with {NBT::heads::1} named "&eüʀüɴ ᴇᴋʟᴇ &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":

                        cursor slot of {_p} doesn't contain air:
                            eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
                            set {_cursor} to cursor slot of {_p}
                            addShopItems("%metadata value "uiEditorMETA" of {_p}%", {_cursor})
                            open guiShopsManager({_p}, metadata value "uiEditorMETA" of {_p}, {_item}) for {_p}

                else:
                    set {_items::*} to getShopsRequirement({_type}, {_i})
                    
        loop {_split::*}:
            {_items::%loop-counter%} is set:
            
                {_type} is "@anemys":
                    set {_i} to getGuiItem("@setup", {_type}, "%{_items::%loop-counter%}%", {NBT::heads::4})
                    
                else:
                
                    set {_i} to getGuiItem("@setup", {_type}, "", {_items::%loop-counter%})
                    
                make gui slot loop-value with {_i}:
                    
                    gui click type is not double click, left mouse with shift or drop key with control:
                        eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
                        set {_i} to {_items::%index of event-slot + 1%}

                        {_type} is "@anemys":
                            open guiShopsManager({_p}, {_i}, {_item}) for {_p}
                            set metadata value "uiEditorMETA" of {_p} to {_i}
                            
                        else:
                            getShops() contains {_i}:
                                set metadata value "uiEditorMETA" of {_p} to {_i}
                                open guiShopsManager({_p}, {_i}, {_item}) for {_p}
                                
                            else:
                                
                                open guiShopsEditor({_p}, "%metadata value "uiEditorMETA" of {_p}%", {_i}) for {_p}
                            
                    else:
                        gui click type is drop key with control:
                            eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
                            
                            {_type} is "@anemys":
                                set {_has} to {_items::%index of event-slot + 1%}
                                removeShop({_has})
                                delete {manager::slot::%{_has}%::*}
                                delete {manager::items::%{_has}%::*}
                                open guiShopsManager({_p}, "@anemys", {_item}) for {_p}

                            else:
                                removeShopItems({_type}, {_items::%index of event-slot + 1%})
                                open guiShopsManager({_p}, {_type}, {_item}) for {_p}
                            
                        else:
                            eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                            send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
                            close {_p}'s inventory
                        
            stop loop if {_items::%loop-counter + 1%} is not set
            
    return last gui

#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#

function guiShopsEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    set {_name} to name of {_item} ? "&a%raw name of {_item}%"
    create gui with virtual chest inventory with 6 rows named "@Item [%{_type} ? "&4&lERROR"%&r] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
    
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")       

        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
            cancel event
            
        make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open guiShopsManager({_p}, {_type}, {_item}) for {_p}

        make gui slot "M" with {NBT::heads::5} named "&eɢᴇʀᴇᴋsɪɴɪᴍ ekle &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":
            cursor slot of {_p} doesn't contain air:
                eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
                addShopsRequirement({_type}, {_item}, cursor slot of {_p})
                open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
        
        set {_lore} to name of {_item} ? "&a%raw name of {_item}%"
        set {_slotNumber} to {manager::slot::%{_type}%::%{_item}%}
        make gui slot "S" with {_item} named "&eᴅüᴢᴇɴʟᴇɴᴇɴ üʀüɴ" with lore "", "&8ʙɪʟɢɪ:", " &7● &fᴀᴅı: %{_lore}%", "" and "&6► &eᴏᴛᴏᴍᴀᴛɪᴋ ᴋᴀʏᴅᴇᴅɪʟɪʀ"
        make gui slot "O" with {NBT::heads::6} named "&esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇç" with lore "", "&8ʙɪʟɢɪ:", " &7● &fsʟᴏᴛ ɴᴜᴍᴀʀᴀsı:&b %({_slotNumber} -1) ? -1%", "" and "&6► &esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇçᴍᴇᴋ ɪçɪɴ &6[ᴛıᴋʟᴀ]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open openSlotEditor({_p}, {_type}, {_item}) for {_p}

        set {_items::*} to getShopsRequirement({_type}, {_item})
        
        loop {_split::*}:
            {_items::%loop-counter%} is set:

                make gui slot loop-value with getGuiItem("@setup", {_item}, "@Item", {_items::%loop-counter%}) :
                    
                    gui click type is drop key with control:
                        eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
                        removeShopsRequirement({_type}, {_item}, {_items::%index of event-slot + 1%})
                        open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
        
    return last gui

#
# @param p = player
# @param type = Shop name
# @param item = Editing item
#

function openSlotEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    set {_name} to name of {_item} ? "&a%raw name of {_item}%"
    create gui with virtual chest inventory with 6 rows named "@Slot [%{_type} ? "&4&lERROR"%] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
    
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
        set {_items::*} to getShopItems({_type})

        loop {_split::*}:
            set {_n} to loop-counter
            {manager::slot::%{_type}%::%{_item}%} != {_n}:
                
                make gui slot loop-value with white stained glass pane named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"
                    set {manager::slot::%{_type}%::%{_item}%} to {_n}
                    open openSlotEditor({_p}, {_type}, {_item}) for {_p}

            else:
                make gui slot loop-value with (* stained glass pane of sharpness 1) named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"

            stop loop if loop-counter = 45
            
        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f"
        
        make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
            
    return last gui

#
# @param p = player
# @param type = Shop name
#

function openShop(p: OFFLINE PLAYER, type: STRING) :: INVENTORY:
    create gui with virtual chest inventory with 6 rows named "%{_type} ? "&4&lERROR"%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
    
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
        #make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
        #    cancel event
            
        set {_items::*} to getShopItems({_type})
        
        loop {_split::*}:
            add 1 to {_n}
            {_items::%{_n}%} is set:

                set {_getSlotNumber} to {_split::%{manager::slot::%{_type}%::%{_items::%{_n}%}%}%}
                
                make gui slot {_getSlotNumber} with getGuiItem("@anemys", {_type}, "@Item", {_items::%{_n}%}) :
                
                    gui click type is not double click:
                        set {_i} to {_items::%{_n}%}
                        set {_list::*} to getShopsRequirement({_type}, {_i})
                        player has getShopsRequirement({_type}, {_i}):
                        
                            remove getShopsRequirement({_type}, {_i}) from {_p}'s inventory
                            give {_i} to {_p}
                            
                        else:
                        
                            eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                            send title "&4&l!" with subtitle "&cɢᴇʀᴇᴋsɪɴɪᴍʟᴇʀɪ ᴋᴀʀşıʟᴀᴍıʏᴏʀsᴜɴᴜᴢ" to player for 5 seconds with fadein 0 second
                            close {_p}'s inventory
                    else:
                        eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                        send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
                        close {_p}'s inventory
    return last gui


CMD:
JavaScript:
command market [<STRING>] [<STRING>]:
    #permission: op
    #permission message: &cBu komutu kullanamazsın
    prefix: @anemys
    trigger:

        set {_p} to player   
        
        arg 1 is "create":
            arg 2 is set:

                hasShop(arg 2) is not true:
                    addShop(arg 2)
                    send formatted("&a%arg 2% adlı market oluşturuldu!") to {_p}
                    
                else:
                    send formatted("&cBu isimde zaten bir market bulunuyor!") to {_p}
                    
            else:
                send formatted("&cLütfen bir market adı girin.") to {_p}
            
        arg 1 is "open":
            arg 2 is set:
                
                hasShop(arg 2) is true:
                    wait a ticks
                    open openShop({_p}, arg 2) for {_p}
                    
                else:
                    send formatted("&cBu isimde bir market bulunamadı!") to {_p}
                    
            else:
                send formatted("&cLütfen bir market adı girin.") to {_p}
                
        arg 1 is not "create", "editor" or "open":
            helpMessage({_p})
            
        arg 1 is "editor":
            open guiShopsManager({_p}, "@anemys", {_item}) for {_p}

tab complete of "market":
    set tab completions for position 1 to "create", "editor" and "open"
    
    tab arg 1 is "open":
        set tab completions for position 2 to getShops()
            
function helpMessage(p: OFFLINE PLAYER):
    send formatted("") to {_p}
    send formatted("/market create (shopName)") to {_p}
    send formatted("/market open (shopName)") to {_p}
    send formatted("/market editor") to {_p}
    send formatted("") to {_p}

HANDLERS:
JavaScript:
function eventHandlerProfile(p: player, type: text, message: text, sound: text, volume: text, pitchType: text):
    wait a tick
    {_pitchType} is "thin":
        play sound "%{_sound}%" at volume 0.3 at pitch 1 to {_p}
    {_pitchType} is "thick":
        play sound "%{_sound}%" at volume 0.3 at pitch 0.8 to {_p}
        
function splitterSensei(split: STRING) :: OBJECTS:
    set {_s::*} to {_split} split at ","
    return {_s::*}
            
function hasShop(s: STRING) :: BOOLEAN:
    return true if {shops::created::*} contains {_s}
    
function addShop(s: STRING):
    add {_s} to {shops::created::*}

function removeShop(s: STRING):
    remove {_s} from {shops::created::*}
    
function getShops() :: OBJECTS:
    return {shops::created::*}
    
function getShopItems(type: STRING) :: OBJECTS:
    return {manager::items::%{_type}%::*}
    
function getShopsRequirement(type: STRING, i: ITEM) :: OBJECTS:
    return {manager::items::%{_type}%::%{_i}%::*}
    
function addShopsRequirement(type: STRING, i: ITEM, t: ITEM):
    add {_t} to {manager::items::%{_type}%::%{_i}%::*}
    
function removeShopsRequirement(type: STRING, i: ITEM, t: ITEM):
    remove {_t} from {manager::items::%{_type}%::%{_i}%::*}
    
function addShopItems(type: STRING, i: ITEM):
    add {_i} to {manager::items::%{_type}%::*}
    
function removeShopItems(type: STRING, i: ITEM):
    remove {_i} from {manager::items::%{_type}%::*}   
    
function formatted(message: TEXT) :: TEXT:
    return formatted {_message}
    
function getGuiItem(m: STRING, type: STRING, name: STRING, i: ITEM) :: ITEM:
    
    {_m} is "@setup":
        {_type} is "@anemys":
            set name of {_i} to {_name}
            set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fɪçᴇʀɪᴋ: &6%size of getShopItems({_name}) ? 0%/45", "&f", "&6► &eᴅüᴢᴇɴʟᴇᴍᴇᴋ ɪçɪɴ: &6[ᴛıᴋʟᴀ]" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]"
        
        else:
            getShops() contains {_type}:
                set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fsʟᴏᴛ ɴᴜᴍᴀʀᴀsı:&b %({manager::slot::%{_type}%::%{_i}%} -1) ? -1%" and " &7● &fɢᴇʀᴇᴋsɪɴɪᴍ:"
                    
                loop getShopsRequirement({_type}, {_i}):

                    set {_in} to loop-value
                    add " &8-&7 %name of {_in} ? raw name of {_in}% &8(&ax%item amount of {_in} ? 1%&8)" to {_lores::*}

                add "&f", "&6► &eᴅüᴢᴇɴʟᴇᴍᴇᴋ ɪçɪɴ: &6[ᴛıᴋʟᴀ]" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]" to {_lores::*}
                
            else:
                set {_lores::*} to "&f" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]]"
    else:
        set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fɢᴇʀᴇᴋsɪɴɪᴍ:" and "&f"
                
        loop getShopsRequirement({_type}, {_i}):

            set {_in} to loop-value
            add " &8-&7 %name of {_in} ? getNormalName({_in})% &8(&ax%item amount of {_in} ? 1%&8)" to {_lores::*}
                    
        add "&f" and "&6► &esᴀᴛıɴ ᴀʟᴍᴀᴋ ɪçɪɴ ᴛıᴋʟᴀ" to {_lores::*}
        
    loop size of {_lores::*} times:
        set line loop-counter of {_i}'s lore to {_lores::%loop-counter%}

    return {_i}
    
function getNormalName(i: ITEM) :: STRING:
    set {_i} to raw name of {_i}
    {_i} contains "minecraft:honey_block":
        set {_i} to "&6[!] &eBal bloğu"
        
    return "%{_i}%"

STATIC ICONS:
JavaScript:
load:
    delete {NBT::heads::*}
    
    loop 10 times:
        set {NBT::heads::%loop-counter%} to a player head
    
    set {_texture} to nbt compound of {NBT::heads::1}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTc3YmI2NmZjNzNhOTdjZWZjYjNhNGJmZGNjYjEyMjgxZjQ0ZGQzMjZjY2QwZmYzOWQ0N2U5ODViZmVmZjM0MyJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::2}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWExZWYzOThhMTdmMWFmNzQ3NzAxNDUxN2Y3ZjE0MWQ4ODZkZjQxYTMyYzczOGNjOGE4M2ZiNTAyOTdiZDkyMSJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::3}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWM5YzY3YTlmMTY4NWNkMWRhNDNlODQxZmU3ZWJiMTdmNmFmNmVhMTJhN2UxZjI3MjJmNWU3ZjA4OThkYjlmMyJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::4}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDQ2NzUxNThjMDc2N2VlNTA4YzUyZDUyNDI2Y2VmM2EyYzJiMjliN2U0ODdjOTI5NTNhMzgyM2Y1NjFkMDZhZiJ9fX0=""}]}}}" to {_texture}
    
    set {_texture} to nbt compound of {NBT::heads::5}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzIzMzJiNzcwYTQ4NzQ2OTg4NjI4NTVkYTViM2ZlNDdmMTlhYjI5MWRmNzY2YjYwODNiNWY5YTBjM2M2ODQ3ZSJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::6}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODE0M2YyMmMwOWM4OGM0MWZiMGM0ZDZmZjI0ZjQ5N2Q4YzI4NjM0NWEwZGY2OTk4YTA1MGNmOTc1OWE3MmQxYSJ9fX0=""}]}}}" to {_texture}
 
Elinize emeğinize sağlık, Skript'inizi düz olarak yeni bir .sk dosyasına yükledim ancak tonla sorun çıktı. Sizde sorunsuz mu çalışıyordu? Ona göre düzeltmeye çalışacağım.
Evet sorunsuz çalışıyor Test ettiğim sürüm:
1.21.8
Skript ve Skbee son sürüm kullanmanı tavsiye ederim.
Aldığın hataları atarsan yardımcı olabilirim.
 
Evet sorunsuz çalışıyor Test ettiğim sürüm:
1.21.8
Skript ve Skbee son sürüm kullanmanı tavsiye ederim.
Aldığın hataları atarsan yardımcı olabilirim.
Ben 1.20.4 kullanıyordum o zaman ondan dolayı hata aldım. Skript'inizi bir de üst sürüm ile deneyeyim. Ayrıca sürümü düşürmek için nereleri değiştirmem gerekir bunu nerden öğrenebilirim?
 
nbt desteği kısıtlı falan değil... ayrıca sunucuyu da yormaz :/


daha önce ShopKeeper tarzı bir skript yapmıştım, bu skript custom marketler oluşturup her öğeye özel gereksinimler tanımlamayı sağlıyor ancak yeni sürümlerde nasıl çalışır bilmiyorum... Sk-gui, Skbee ve Sk 2.8+ gerekiyor (yani 1.20.4 için böyleydi...). bu skripti eklentimi geliştirmek için yapmıştım.. basit bir prototip. yani 30dk da yapılan bir skript ne kadar güvenilir olur bilmiyorum ancak sorun çıkartacağını da sanmam :') bunu eklenti olarak geliştirmemin sebebi ise skript'in çok saçma bir karşılaştırma bug'una sahip olması... belki yeni sürümlerde bu sorun çözülmüştür.

video:


GUI:
Kod:
#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#

function guiShopsManager(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    create gui with virtual chest inventory with 6 rows named "@Editör [%{_type} ? "&4&lERROR"%&r]" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
   
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
       
        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
            cancel event
           
        edit gui last gui:
       
            {_type} is "@anemys":
                set {_items::*} to getShops() if {shops::created::*} is set
               
            else:
                getShops() contains {_type}:
                    set {_items::*} to getShopItems({_type})

                    make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
                        eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
                        open guiShopsManager({_p}, "@anemys", {_item}) for {_p}
               
                    make gui slot "N" with {NBT::heads::1} named "&eüʀüɴ ᴇᴋʟᴇ &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":

                        cursor slot of {_p} doesn't contain air:
                            eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
                            set {_cursor} to cursor slot of {_p}
                            addShopItems("%metadata value "uiEditorMETA" of {_p}%", {_cursor})
                            open guiShopsManager({_p}, metadata value "uiEditorMETA" of {_p}, {_item}) for {_p}

                else:
                    set {_items::*} to getShopsRequirement({_type}, {_i})
                   
        loop {_split::*}:
            {_items::%loop-counter%} is set:
           
                {_type} is "@anemys":
                    set {_i} to getGuiItem("@setup", {_type}, "%{_items::%loop-counter%}%", {NBT::heads::4})
                   
                else:
               
                    set {_i} to getGuiItem("@setup", {_type}, "", {_items::%loop-counter%})
                   
                make gui slot loop-value with {_i}:
                   
                    gui click type is not double click, left mouse with shift or drop key with control:
                        eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
                        set {_i} to {_items::%index of event-slot + 1%}

                        {_type} is "@anemys":
                            open guiShopsManager({_p}, {_i}, {_item}) for {_p}
                            set metadata value "uiEditorMETA" of {_p} to {_i}
                           
                        else:
                            getShops() contains {_i}:
                                set metadata value "uiEditorMETA" of {_p} to {_i}
                                open guiShopsManager({_p}, {_i}, {_item}) for {_p}
                               
                            else:
                               
                                open guiShopsEditor({_p}, "%metadata value "uiEditorMETA" of {_p}%", {_i}) for {_p}
                           
                    else:
                        gui click type is drop key with control:
                            eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
                           
                            {_type} is "@anemys":
                                set {_has} to {_items::%index of event-slot + 1%}
                                removeShop({_has})
                                delete {manager::slot::%{_has}%::*}
                                delete {manager::items::%{_has}%::*}
                                open guiShopsManager({_p}, "@anemys", {_item}) for {_p}

                            else:
                                removeShopItems({_type}, {_items::%index of event-slot + 1%})
                                open guiShopsManager({_p}, {_type}, {_item}) for {_p}
                           
                        else:
                            eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                            send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
                            close {_p}'s inventory
                       
            stop loop if {_items::%loop-counter + 1%} is not set
           
    return last gui

#
# @param p = player
# @param type = Shop name
# @param item = Edit shop item
#

function guiShopsEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    set {_name} to name of {_item} ? "&a%raw name of {_item}%"
    create gui with virtual chest inventory with 6 rows named "@Item [%{_type} ? "&4&lERROR"%&r] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
   
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")      

        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
            cancel event
           
        make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open guiShopsManager({_p}, {_type}, {_item}) for {_p}

        make gui slot "M" with {NBT::heads::5} named "&eɢᴇʀᴇᴋsɪɴɪᴍ ekle &8[&6&l+&8]" with lore "", "&7üʀüɴü süʀüᴋʟᴇʏɪᴘ ʙᴜ sʟᴏᴛᴀ" and "&7ʏᴇʀʟᴇşᴛɪʀɪɴ.":
            cursor slot of {_p} doesn't contain air:
                eventHandlerProfile({_p}, "1", "forGui", "entity.enderman.teleport", "0.1", "thin")
                addShopsRequirement({_type}, {_item}, cursor slot of {_p})
                open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
       
        set {_lore} to name of {_item} ? "&a%raw name of {_item}%"
        set {_slotNumber} to {manager::slot::%{_type}%::%{_item}%}
        make gui slot "S" with {_item} named "&eᴅüᴢᴇɴʟᴇɴᴇɴ üʀüɴ" with lore "", "&8ʙɪʟɢɪ:", " &7● &fᴀᴅı: %{_lore}%", "" and "&6► &eᴏᴛᴏᴍᴀᴛɪᴋ ᴋᴀʏᴅᴇᴅɪʟɪʀ"
        make gui slot "O" with {NBT::heads::6} named "&esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇç" with lore "", "&8ʙɪʟɢɪ:", " &7● &fsʟᴏᴛ ɴᴜᴍᴀʀᴀsı:&b %({_slotNumber} -1) ? -1%", "" and "&6► &esʟᴏᴛ ɴᴜᴍᴀʀᴀsı sᴇçᴍᴇᴋ ɪçɪɴ &6[ᴛıᴋʟᴀ]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open openSlotEditor({_p}, {_type}, {_item}) for {_p}

        set {_items::*} to getShopsRequirement({_type}, {_item})
       
        loop {_split::*}:
            {_items::%loop-counter%} is set:

                make gui slot loop-value with getGuiItem("@setup", {_item}, "@Item", {_items::%loop-counter%}) :
                   
                    gui click type is drop key with control:
                        eventHandlerProfile({_p}, "1", "forGui", "block.note_block.bell", "0.1", "thin")
                        removeShopsRequirement({_type}, {_item}, {_items::%index of event-slot + 1%})
                        open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
       
    return last gui

#
# @param p = player
# @param type = Shop name
# @param item = Editing item
#

function openSlotEditor(p: OFFLINE PLAYER, type: STRING, item: ITEM) :: INVENTORY:
    set {_name} to name of {_item} ? "&a%raw name of {_item}%"
    create gui with virtual chest inventory with 6 rows named "@Slot [%{_type} ? "&4&lERROR"%] - %{_name}%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
   
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
        set {_items::*} to getShopItems({_type})

        loop {_split::*}:
            set {_n} to loop-counter
            {manager::slot::%{_type}%::%{_item}%} != {_n}:
               
                make gui slot loop-value with white stained glass pane named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"
                    set {manager::slot::%{_type}%::%{_item}%} to {_n}
                    open openSlotEditor({_p}, {_type}, {_item}) for {_p}

            else:
                make gui slot loop-value with (* stained glass pane of sharpness 1) named "&fsʟᴏᴛ: &e%{_n}-1% &8[&6##ID-%{_split::%{_n}%}%&o/@%{_type}%&8]"

            stop loop if loop-counter = 45
           
        make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f"
       
        make gui slot "K" with {NBT::heads::2} named "&eöɴᴄᴇᴋɪ sᴀʏғᴀ &8[&6&l<&8]":
            eventHandlerProfile({_p}, "1", "forGui", "ui.button.click", "0.1", "thin")
            open guiShopsEditor({_p}, {_type}, {_item}) for {_p}
           
    return last gui

#
# @param p = player
# @param type = Shop name
#

function openShop(p: OFFLINE PLAYER, type: STRING) :: INVENTORY:
    create gui with virtual chest inventory with 6 rows named "%{_type} ? "&4&lERROR"%" and shape "0123456789abcdefghijklmnoprstuvyzxwABCDEFGHIJKLMNOPRST":
   
        set {_split::*} to splitterSensei("0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,r,s,t,u,v,y,z,x,w,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T")
        #make gui slot "K", "L", "M", "N", "O", "P", "R", "S" and "T" with black stained glass pane named "&f":
        #    cancel event
           
        set {_items::*} to getShopItems({_type})
       
        loop {_split::*}:
            add 1 to {_n}
            {_items::%{_n}%} is set:

                set {_getSlotNumber} to {_split::%{manager::slot::%{_type}%::%{_items::%{_n}%}%}%}
               
                make gui slot {_getSlotNumber} with getGuiItem("@anemys", {_type}, "@Item", {_items::%{_n}%}) :
               
                    gui click type is not double click:
                        set {_i} to {_items::%{_n}%}
                        set {_list::*} to getShopsRequirement({_type}, {_i})
                        player has getShopsRequirement({_type}, {_i}):
                       
                            remove getShopsRequirement({_type}, {_i}) from {_p}'s inventory
                            give {_i} to {_p}
                           
                        else:
                       
                            eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                            send title "&4&l!" with subtitle "&cɢᴇʀᴇᴋsɪɴɪᴍʟᴇʀɪ ᴋᴀʀşıʟᴀᴍıʏᴏʀsᴜɴᴜᴢ" to player for 5 seconds with fadein 0 second
                            close {_p}'s inventory
                    else:
                        eventHandlerProfile({_p}, "1", "forGui", "minecraft:entity.villager.no", "0.1", "thin")
                        send title "&4&l!" with subtitle "&cʟüᴛғᴇɴ ʙɪʀᴀᴢ ɴᴀᴢɪᴋ ᴏʟᴜɴ" to player for 5 seconds with fadein 0 second
                        close {_p}'s inventory
    return last gui


CMD:
JavaScript:
command market [<STRING>] [<STRING>]:
    #permission: op
    #permission message: &cBu komutu kullanamazsın
    prefix: @anemys
    trigger:

        set {_p} to player  
       
        arg 1 is "create":
            arg 2 is set:

                hasShop(arg 2) is not true:
                    addShop(arg 2)
                    send formatted("&a%arg 2% adlı market oluşturuldu!") to {_p}
                   
                else:
                    send formatted("&cBu isimde zaten bir market bulunuyor!") to {_p}
                   
            else:
                send formatted("&cLütfen bir market adı girin.") to {_p}
           
        arg 1 is "open":
            arg 2 is set:
               
                hasShop(arg 2) is true:
                    wait a ticks
                    open openShop({_p}, arg 2) for {_p}
                   
                else:
                    send formatted("&cBu isimde bir market bulunamadı!") to {_p}
                   
            else:
                send formatted("&cLütfen bir market adı girin.") to {_p}
               
        arg 1 is not "create", "editor" or "open":
            helpMessage({_p})
           
        arg 1 is "editor":
            open guiShopsManager({_p}, "@anemys", {_item}) for {_p}

tab complete of "market":
    set tab completions for position 1 to "create", "editor" and "open"
   
    tab arg 1 is "open":
        set tab completions for position 2 to getShops()
           
function helpMessage(p: OFFLINE PLAYER):
    send formatted("") to {_p}
    send formatted("/market create (shopName)") to {_p}
    send formatted("/market open (shopName)") to {_p}
    send formatted("/market editor") to {_p}
    send formatted("") to {_p}

HANDLERS:
JavaScript:
function eventHandlerProfile(p: player, type: text, message: text, sound: text, volume: text, pitchType: text):
    wait a tick
    {_pitchType} is "thin":
        play sound "%{_sound}%" at volume 0.3 at pitch 1 to {_p}
    {_pitchType} is "thick":
        play sound "%{_sound}%" at volume 0.3 at pitch 0.8 to {_p}
       
function splitterSensei(split: STRING) :: OBJECTS:
    set {_s::*} to {_split} split at ","
    return {_s::*}
           
function hasShop(s: STRING) :: BOOLEAN:
    return true if {shops::created::*} contains {_s}
   
function addShop(s: STRING):
    add {_s} to {shops::created::*}

function removeShop(s: STRING):
    remove {_s} from {shops::created::*}
   
function getShops() :: OBJECTS:
    return {shops::created::*}
   
function getShopItems(type: STRING) :: OBJECTS:
    return {manager::items::%{_type}%::*}
   
function getShopsRequirement(type: STRING, i: ITEM) :: OBJECTS:
    return {manager::items::%{_type}%::%{_i}%::*}
   
function addShopsRequirement(type: STRING, i: ITEM, t: ITEM):
    add {_t} to {manager::items::%{_type}%::%{_i}%::*}
   
function removeShopsRequirement(type: STRING, i: ITEM, t: ITEM):
    remove {_t} from {manager::items::%{_type}%::%{_i}%::*}
   
function addShopItems(type: STRING, i: ITEM):
    add {_i} to {manager::items::%{_type}%::*}
   
function removeShopItems(type: STRING, i: ITEM):
    remove {_i} from {manager::items::%{_type}%::*}  
   
function formatted(message: TEXT) :: TEXT:
    return formatted {_message}
   
function getGuiItem(m: STRING, type: STRING, name: STRING, i: ITEM) :: ITEM:
   
    {_m} is "@setup":
        {_type} is "@anemys":
            set name of {_i} to {_name}
            set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fɪçᴇʀɪᴋ: &6%size of getShopItems({_name}) ? 0%/45", "&f", "&6► &eᴅüᴢᴇɴʟᴇᴍᴇᴋ ɪçɪɴ: &6[ᴛıᴋʟᴀ]" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]"
       
        else:
            getShops() contains {_type}:
                set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fsʟᴏᴛ ɴᴜᴍᴀʀᴀsı:&b %({manager::slot::%{_type}%::%{_i}%} -1) ? -1%" and " &7● &fɢᴇʀᴇᴋsɪɴɪᴍ:"
                   
                loop getShopsRequirement({_type}, {_i}):

                    set {_in} to loop-value
                    add " &8-&7 %name of {_in} ? raw name of {_in}% &8(&ax%item amount of {_in} ? 1%&8)" to {_lores::*}

                add "&f", "&6► &eᴅüᴢᴇɴʟᴇᴍᴇᴋ ɪçɪɴ: &6[ᴛıᴋʟᴀ]" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]" to {_lores::*}
               
            else:
                set {_lores::*} to "&f" and "&6► &esɪʟᴍᴇᴋ ɪçɪɴ: &6[ᴄᴛʀʟ+ǫ]]"
    else:
        set {_lores::*} to "&f", "&8ʙɪʟɢɪ:", " &7● &fɢᴇʀᴇᴋsɪɴɪᴍ:" and "&f"
               
        loop getShopsRequirement({_type}, {_i}):

            set {_in} to loop-value
            add " &8-&7 %name of {_in} ? getNormalName({_in})% &8(&ax%item amount of {_in} ? 1%&8)" to {_lores::*}
                   
        add "&f" and "&6► &esᴀᴛıɴ ᴀʟᴍᴀᴋ ɪçɪɴ ᴛıᴋʟᴀ" to {_lores::*}
       
    loop size of {_lores::*} times:
        set line loop-counter of {_i}'s lore to {_lores::%loop-counter%}

    return {_i}
   
function getNormalName(i: ITEM) :: STRING:
    set {_i} to raw name of {_i}
    {_i} contains "minecraft:honey_block":
        set {_i} to "&6[!] &eBal bloğu"
       
    return "%{_i}%"

STATIC ICONS:
JavaScript:
load:
    delete {NBT::heads::*}
   
    loop 10 times:
        set {NBT::heads::%loop-counter%} to a player head
   
    set {_texture} to nbt compound of {NBT::heads::1}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTc3YmI2NmZjNzNhOTdjZWZjYjNhNGJmZGNjYjEyMjgxZjQ0ZGQzMjZjY2QwZmYzOWQ0N2U5ODViZmVmZjM0MyJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::2}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWExZWYzOThhMTdmMWFmNzQ3NzAxNDUxN2Y3ZjE0MWQ4ODZkZjQxYTMyYzczOGNjOGE4M2ZiNTAyOTdiZDkyMSJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::3}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWM5YzY3YTlmMTY4NWNkMWRhNDNlODQxZmU3ZWJiMTdmNmFmNmVhMTJhN2UxZjI3MjJmNWU3ZjA4OThkYjlmMyJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::4}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDQ2NzUxNThjMDc2N2VlNTA4YzUyZDUyNDI2Y2VmM2EyYzJiMjliN2U0ODdjOTI5NTNhMzgyM2Y1NjFkMDZhZiJ9fX0=""}]}}}" to {_texture}
   
    set {_texture} to nbt compound of {NBT::heads::5}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzIzMzJiNzcwYTQ4NzQ2OTg4NjI4NTVkYTViM2ZlNDdmMTlhYjI5MWRmNzY2YjYwODNiNWY5YTBjM2M2ODQ3ZSJ9fX0=""}]}}}" to {_texture}

    set {_texture} to nbt compound of {NBT::heads::6}
    add nbt from "{display:{Name:{""text"":""@anemys""}},SkullOwner:{Id:[I;-378043965,-939965068,-1774373808,-1695815522],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODE0M2YyMmMwOWM4OGM0MWZiMGM0ZDZmZjI0ZjQ5N2Q4YzI4NjM0NWEwZGY2OTk4YTA1MGNmOTc1OWE3MmQxYSJ9fX0=""}]}}}" to {_texture}

Bu benim için çok üst düzeyde bir Skript nasıl kuracağımı bile anlayamadım 😅 elinize emeğinize sağlık ancak eşya gereksinimi haricinde balance veya xp ayarlanamadığı için benim isteğimi karşılayamayacaktır.

Kullanım açısından eğer token tarzı bir şey satılırsa oyun içi parasıyla onlarla birleştirilse elbette bu şekilde de kullanılabilir. Tekrardan elinize emeğinize sağlık, paylaştığınız bu güzel skript için teşekkürler.
 
Ben 1.20.4 kullanıyordum o zaman ondan dolayı hata aldım. Skript'inizi bir de üst sürüm ile deneyeyim. Ayrıca sürümü düşürmek için nereleri değiştirmem gerekir bunu nerden öğrenebilirim?
1.20.4 neden kullanıyorsun mesela? Pluginleri güncellemen yeterli olur diye düşünüyorum olmazsa hatayı görmeden bir şey diyemem.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl
Üst