Goblin Traders (Fabric)

Goblin Traders (Fabric)

7M Downloads

[Bug] Goblins don't seem to restock

elpocoburrito opened this issue ยท 12 comments

commented

Minecraft Username

ElPocoBurrito

Version

1.5.1

Minecraft Version

1.18.2

What did you expect?

I have a name-tagged and trapped goblin trader (overworld type).
After trading my Iron ore with the goblin trader until he went out of stock, i waited for around 8-12 in-game days (No sleep to skip nights, not sure if it matters) yet i still couldn't trade more iron ore. All other trades seem to work though, but of course they never were out of stock.

I double checked and the option CAN_BE_RESTOCKED = X is set to true in both the server and clients config.

What did you get?

I wasn't able to trade iron ore with the goblin as it remained out of stock.

Additional note: Another user's comment on the curseforge page mentionned having the same issue. It said something along the lines of "The goblin trades dont seem to restock even after long periods."

commented

Unfortunately the way that the game code works is that it sets a restock tag to the entity itself, only newly spawned traders after the option is toggled can restock. I'll leave it up to jab if he wants to fix this.

The setting has been enabled all along, so i doubt its caused by what you described.

commented

wha: https://github.com/Jab125/goblin-traders-fabric/blob/1.19/src/main/java/net/hat/gt/entities/AbstractGoblinEntity.java#L132

I looked at that line you linked, is it saying that, if i hold 30+ of the goblin's favorite food in my main hand, the goblin will eat it and re-stock?

Is that supposed to be the normal way to restock, an alternate option or something else? I forget where i read it, but wasn't the intended way to restock is to wait 1 full day?

Edit: Tested interacting with the goblin while holding 30 apples, he gets the little green star particles (like villagers) but no apples get consumed.
After reading the code you linked, i can only assume that:

  1. The code, for some reason, doesnt consider my setting to be set to the right value (Can goblins restock setting)
  2. For some reason, the goblin isnt deemed out of stock, even though he is definitely out of iron.

Screenshots of goblin trade along with screenshot of server goblin traders config:
gobta2
gobta1

commented

Unfortunately the way that the game code works is that it sets a restock tag to the entity itself, only newly spawned traders after the option is toggled can restock. I'll leave it up to jab if he wants to fix this.

commented

It seems like "every trade" needs to be sold out

commented

Bump, dont want to be rude but it'd be awesome to have a reply with any information, even if the awnser is "I'm too busy to fix at the moment, sorry".

Snippets along with "Hmm" are only confusing me further ๐Ÿ˜…

commented

Gotcha, that is an interesting thought, although i can't seem to make the goblin out of stock for other trades. I haven't tested them all but every overworld goblin seen to have less than a stack of iron trades but a near infinite supply of gold trades, for example (i traded 700 raw gold in one go for example, it never sold out).
Those results have been consistent across over 5 goblins.

commented
    private boolean noStockLeft() {
        AtomicBoolean b = new AtomicBoolean(true);
        this.getOffers().forEach((tradeOffer) -> {
            if (!(tradeOffer.isDisabled())) b.set(false);
        });
        return b.get();
    }

Hmmm

commented

So, can anyone tell me in a single message what are the requirements to get my trades to refresh?

commented

Hello, new to this but I cannot seem to find the code for the goblins restocking automatically by time, I've only found the code for restocking them manually with apples after they have been completely bought out. Tried and tested that the latter works but former does not. I had 2 goblins, 1 control where I bought one stock and one which I bought everything and fed it apples, voila! it restocked.

commented

Buy out the entire stock and feed the Goblin it's favorite food.

Leaving this as an 'open issue' until a more user friendly solution is implemented.

commented

I, too, am having this issue of the goblins not restocking their offers after 2400s. What is the goblin's favorite food?