#Components problem and sell function

1 messages · Page 1 of 1 (latest)

wheat folio
#

Hello, I have an item sale function.

However, due to a recent Spawner issue on my server, all mobs are dropping items with extra components.

For example, the Gunpowder that drops from Creeper has a normal component count of 8, while the one that drops from my Spawners has 9 components.

The problem is that a powder with 8 components can be sold in this function without any problem, while a powder with 9 components cannot be sold.

How can I solve this problem temporarily, is there anything I can include in the code?

function sell(player: player, item: item, price: number):
    if {_player} has {_item}:
        set {_items} to amount of {_item} in {_player}'s inventory
        set {_total} to ({_items} * {_price})
        remove all {_item} from {_player}'s inventory
        play "ENTITY_VILLAGER_TRADE" to {_player} at volume 10
        add {_total} to balance of {_player}
        send "" to {_player}
        send " Envanterinizdeki ürünler satıldı. &e%{_total}% &6⛁ &7ödeme aldınız!" to {_player}
        send "" to {_player}
        add {_items} to {tuccarSatis::%{_player}%}
    else:
        send "" to {_player}
        send " Envanterinizde ilgili üründen bulunmuyor!" to {_player}
        send "" to {_player}
        play "ENTITY_VILLAGER_AMBIENT" to {_player} at volume 10
thick tartan
#

probably get the type of {_item}, then check amount of items of that type in the player's inventory

#

very strange that the spawners are doing that