Globox1997 / VillagerQuests

https://modrinth.com/mod/villagerquests
https://www.curseforge.com/minecraft/mc-mods/villagerquests
MIT License
3 stars 7 forks source link

The button has been unable to click. #19

Open yyz729 opened 2 years ago

yyz729 commented 2 years ago

The button has been unable to click. Is there an error in the data package? The version is 1.0.3 of 1.18.2.

gamingoninsulin commented 2 years ago

I used this version just fine may be didnt coded the .json files you can howerver check 5he .json file through https://jsonlint.com/ and paste your .json code to check tif its valid code let us know if you found something !

Globox1997 commented 2 years ago

Could be a couple of reasons but gamingoninsulin already mentioned the most possible one. If you give more info zhao, then we can help better

TheCompWiz commented 2 years ago

I'm running on the same versions... and I can't seem to figure out how to get the villagers to pickup any quests. I've added a dozen or so villagers in a test map, and added 3 quests for testing. Any tips for debugging this? ... When I look at the villager data.... I only see "QuestIds[I;]" which makes me think it isn't getting the quests... and I've tried to manually assign a quest ID to a villager, but it immediately disappears.

Any help would be greatly appreciated.

TheCompWiz commented 2 years ago

Digging through the code, and doing some testing I noticed that the "newQuestTicker" is always -1... and the ticker doesn't know what to do when it reaches -1. I modified the tickMixin function on the VillagerEntityMixin,

            if (this.newQuestTicker == -1) {
                MerchantQuests.addRandomMerchantQuests(merchantEntity, 1);
                this.newQuestTicker = VillagerQuestsMain.CONFIG.newQuestTimer + this.merchantEntity.world.random.nextInt(VillagerQuestsMain.CONFIG.newQuestTimer);
            }

Not sure if this is correct, but I did see the villagers picking up quests now... and I was able to complete them.

Globox1997 commented 2 years ago

The issue with getting new quests for villagers is, the villager gets firstly quests on initialization not when new quests are added via datapacks. The newQuestTicker is only used if the player finished a quest for the specific villager. With https://github.com/Globox1997/VillagerQuests/commit/4383f3d5cdc72763013eb7b85ad781c16aeb57d7 the villager has initially a timer which runs down, after initialization this can't get changed either, only applies on new ones