I want to run some logic first and if it fails cancel the reward but cancelling it still consumes the event.
What I'm doing is generating a map item with location to certain biomes, but if it fails to locate (player too far or in incompatible dimension) I want to cancel the event and let the player try again until it succeeds.
I also tried to workaround by completing the task if it fails so player can try again but there is some weird desync going on and needs to restart client to take effect.
Please help 
#Cancel a FTB Quest Custom reward event still consumes the reward
92 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
I cant speak for what you are trying to do but I am doing something similar with the new pathfinder quills from quark on my modpack
and did you manage to work?
yes
let me show you
Item.of('quark:pathfinders_quill', "{display:{Name:'{\"text\":\"Desert\"}'},targetBiome:\"minecraft:desert\",targetBiomeColor:12963328}")
thats the kjs item
you just change the targetBiome to whatever you want
the command I used is something like /give @s quark:pathfinders_quill{targetBiome:"minecraft:desert"}
you can add the other tags like target biome color which changes the little bottle color
This doesn't really concern with KUBEJS, I just did it with giving myself those items and then importing the reward table from chest in FTB quests
this quark tihng executes the logic when after you get the item and rightclick or something?
yes
once in your inventory, you right click and it generates a map
you get a little indicator and animation at the bottom left that says Searching...
Then you get a map like this
i already got a working logic but my problem is when you fail to locate
what happens if you go to Nether
and try to locate something like river
let me try
so your problem is basically that your locate thing works but when it fails to locate you want it to reset the quest? is that correct?
yes, currently it will consume the item and you get no "refund"
when it fails it doesn't give you a map or the quill back
so you would have the same issue
but is your quest a one time thing?
no, like a Shop
le me see
What im thinking is that instead of trying to cancel you can reset the progress of the quest
that wont give the person their items back
may i look at le code
Paste version of test_quest.js from @thin raft
maybe the quest event is specific to player?
is that an attr?
It's all that I could think of
And that's why the cancel event doesn't fire
also, is the quest reward cancellable???
like is the event cancellable
ProbleJS said it is 😐
can be a FTB Quest problem not checking if it is cancelled too
i'm starting to think that all FTB Quest events are not cancellable lol
bruh
they might not be
but why is cancel relevant when you just want to give the player their stuff back? result == null works correctly right?
if cancel worked I wouldn't need to give their stuff back
now I need to find a way to programatically give their stuff back
like getting the itemstacks of the quest
🤦♂️
function refund(serverPlayer, quest){
let tasks = quest.tasks
let itemStack
tasks.forEach(task =>{
if (task.consumesResources() && task.getType() == $TaskTypes.ITEM){
itemStack = task.item.copy()
itemStack.setCount(task.count)
serverPlayer.sendMessage(Component.green("Refunding " + itemStack), $Util.NIL_UUID)
$ItemStackHooks.giveItem(serverPlayer, itemStack)
}
})
}
EPIC
is your modpack public or something? xD
what MC version?
1.19.2
🙂
🙂
im trying to make a mix between MC eternal and sevtech (not as hardcore as sevtech)
and in mind is in-world interaction, so not lots of menus and more interacting with the world, like structures, mob hunting, biome hunting for specific resources, etc.
and it's sorta expert, I have epic siege mod to make mobs more difficult and recipes aren't ridiculous but definetely more challenging and encourage you to go out and about
very nice 👏
What's yours about?
i'm just a contributor on All The Mods Gravitas
ooo
I was playing tfc reloaded last week with some friends and then had to double down on uni
and so i finished yesterday so I started working on the pack again
But I got work this week and i gotta catch up with all the stuff I haven't done since last week
TFC is going to 1.20 so I am excited for that x)
yeah
I think TFC will stay forever
I wish pyrotech would update but the guy is stubborn
I was thinking of making a mod that's similar to Lychee but with mechanics and blocks
and then have them included in the game via config
So for example the pyrotech bloomery and smelting process is so unique, I Would so something similar to that.
Or maybe sifting but add an actual gui or minigame
I'm a fan of minigames for crafting