[ PMC Lucky Block Data Pack Community Event ] Kyleong's lucky blocks entry

Community Event Participant!
This Data Pack is in the PMC Lucky Block Data Pack Community Event which is now Complete!
See the All Entries!

  • check_circle Functions
  • 3
  • 2
  • 7
avatar kyleong
Level 34 : Artisan Engineer
23
This is an entry for the Planet Minecraft Community Lucky Block Data Pack event! (PMC lucky block)

info of the event [​event ended]

event result

how to install data pack tutorial from Minecraft wiki

enjoy!

Options
CreditEntry for: PMC Lucky Block Data Pack Community Event
CompatibilityMinecraft 1.16
Tags

3 Update Logs

Update v1.0.3 (final update) : 07/05/2020 11:50:46 amJul 5th

*This is just a final adjustment before the PMC lucky block submission deadline, doesn't add any more options

fixed bugs

reward loot changed along with the cost of the lucky block
LOAD MORE LOGS

2
07/02/2020 8:13 am
Level 53 : Grandmaster Cyborg
Bertiecrafter
Hey! This is a very neat little datapack, the options are really fun minigames and short enough. Nicely done :D
1
07/02/2020 8:35 amhistory
Level 53 : Grandmaster Cyborg
Bertiecrafter
Based on the code for the fish quest, here are some points of improvement:
- Using @p won't work, since the schedule command will run at worldspawn instead of the fish spawn location.
- Multiple instances of the same quest won't work, since you're testing globally for the existance of an entity, instead of based on location. Also schedule is not used in a way that supports non-global commands.
- One of the quests is missing a space in the message to chat. Maybe you could use the info field in the template command as well.
- Fail messages could use some proper capitalization =) ("Anvils are falling (...)" instead of "anvil is falling (...)")

For the first two points, you might want to spawn an invisible armor stand or area affect cloud for each of the events and use the scoreboard to track time left. You create the objective in the load function, remove it in the uninstall function and decrease for all armor stands with a certain tag in the tick function (20/s). Once the objective hits zero, you simply kill all fish or whatever entity and the armor stand. Instead of using the schedule command, you can also use tick to run a function every 1/20th of a second.
So your tick function would contain commands like:

execute as @e[​tag=kylong_fish_quest] at @s run function (...)/fish_loop
execute as @e[​tag=kylong_fish_quest,scores={klng_timer=0}] at @s run function (...)/fail
scoreboard players remove @e[​scores={klng_timer=1..}] klng_timer 1

The commands mean that the given function will be run AT and AS each found entity. As a result, @p will work again, you can use @e[​distance=..10] to kill all spawned entities within 10 blocks (instead of all across the map) and @s to kill the armor stand itself.

Hopefully this can help you make the quests multiplayer compatible and multi-instance.
2
07/02/2020 9:28 am
Level 34 : Artisan Engineer
kyleong
Sorry I was not thinking about multiplayer compatibility.
Thank you so much for the in-depth feedback! they are very detailed!
1
07/05/2020 10:25 am
Level 53 : Grandmaster Cyborg
Bertiecrafter
Not quite right, but looking good so far!

- The "rain" option is still called "anvil rain" while it might not drop anvils.
- In the tick function, make sure to check what entity will be your "as" and what entity will be your "at". For fish, you kill all fish around the area_affect_cloud and give @s a nice message. However, for the "hit" quest, your "at" and "as" are both the area affect cloud. This means that in hit_success, you are trying to /tellraw the cloud xD Also note that the file also contains "kill @s" which would obviously kill the player if you tried to make the nearest player your "as".

Try to make it consistent so that the "at" entity will be the location of the event, while the "as" entity will be the player that failed/succeeded. You'll have to edit both the tick and actual option functions for that.
1
07/05/2020 11:55 amhistory
Level 34 : Artisan Engineer
kyleong
Now it should be good to go. I didn't make it "as" the player, I just change the /tellraw target to @p.
I may make commands consistent in my future work, but not this time. I don't want to raise the chance of make another mistake, which further increases your work.

Thanks!
2
07/05/2020 1:15 pm
Level 53 : Grandmaster Cyborg
Bertiecrafter
Fair enough, I'm impressed at how far you were able to twist the creation around and show some beautiful commands in the tick function. Well done =)
1
07/02/2020 12:42 pm
Level 53 : Grandmaster Cyborg
Bertiecrafter
No problem, I forgot to mention that you should probably fix the others in the same way, since I assume you used the schedule mechanics everywhere XD
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome