Funwayguy / BetterQuesting

MIT License
56 stars 100 forks source link

[question] How do I use the standard trigger option? #663

Open Winddbourne opened 4 years ago

Winddbourne commented 4 years ago

I was looking for a way to trigger quests based on the player's Minecraft statistics . . . time played, time since last death, etc . . . I'm fairly sure I should use a standard trigger to do this but there is no documentation available and it's not immediately obvious.

would this work? minecraft.custom:minecraft.play_one_minute = [number of ticks]

or this

minecraft.custom:minecraft.play_one_minute > [number of ticks]

or do I neep an @p function line to direct it at the player?

I'm lost. lol

Funwayguy commented 4 years ago

triggers are actually part of what vanilla advancements use, the format for which you can find here: https://minecraft.gamepedia.com/Advancements/JSON_format

For statistics, scoreboard tasks can actually use those as variable types although you need to make sure you're using the right name. You seem to be trying to use the 1.14.4 format which is different from 1.12.2.

Winddbourne commented 4 years ago

Thanks, I'll take a look at the scoreboard feature and see if I can find that 1.12.2 format instead of the 1.14 stuff that came up on a quick search. Crossing my fingers that I can make this work. I've got so many ideas for using statistics. lol

Winddbourne commented 4 years ago

I think I got it . . . originally I wasn't going to the right spot since type is an advanced option but . . . Now I think I have it figured. :)

Funwayguy commented 4 years ago

I'm thinking I may make this a dedicated task type considering how may people want to hook various statistics and vanilla Minecraft's scoreboard system, although supports it, is a bit unwieldy to setup.

Winddbourne commented 4 years ago

That is probably a good idea. It's simply so extremely useful.

I was going to use time stages to unlock things slowly after the player had been in the world for a while but I was having an issue where the timer would sometimes reset when you logged out. In a test game, it took two hours of playtime to run a twenty-minute clock all the way through. But I knew it had been two hours by looking at my time played stat. I may not be right on the money referencing that stat but I'll be pretty close.

I can also unlock things now using how many centimeters the player has walked, swum, snuck, run, or flown. I'm now testing a game where I unlock medium-sized animals spawning after the player walks 5000 blocks.

It's probably too long a journey but I'm using both using a mod that lowers starting hearts and primal core which slows down the early game . . . balancing it to ease players into the world will take some time.

What other semi-random timers might I use? Blocks broken sounds like a good one. Times died might be fun as well. Mix it in with quests to craft items and quests to hunt entities and I can make the world react to the player in a very dynamic and natural sort of way.

It's hard to overstate how many options just opened up for me.