16

PMC Lucky Blocks | A data pack event for anyone and everyone!archive

Bertiecrafter's Avatar Bertiecrafter6/6/20 12:57 pm history
16 emeralds 1.3k 77
7/14/2020 11:31 am
Bertiecrafter's Avatar Bertiecrafter


Planet Minecraft Lucky Blocks Data Pack Event

We're excited to introduce the first official data pack event on Planet Minecraft!
View the full event details page to read all about it and familiarize yourself with the rules.

Introduction video to the framework

Note: The video is slightly outdated. You now get a skull item instead of egg and you craft it using a gold block instead of ingot.





After learning what the event is about follow the steps below:

Getting Setup : Framework Download and Setup


1) Download the .zip file containing the framework and unzip it to your datapacks folder. This folder is accessible by clicking Edit > Open World Folder while having a world selected in the single player menu. Your datapacks folder should now contain a "PMC Lucky Blocks" folder with a "data" folder inside. Run the /reload command and make sure you see a message in chat telling you that the datapack loaded.

2) Open up the data folder and rename the "steve" folder to something you own, like your Minecraft username. The name you used will be your "namespace".

3) Open the folder: bertiecrafter/tags/functions/pmclb and edit each file inside. Replace all occurrences of "steve" with the namespace you defined in step 2.

4) Open the <your namespace>/functions/pmclb and edit the load.mcfunction file. On the second line, write "say IT WORKS!", save and exit.

5) Assuming Minecraft is still running with the customized datapack world, type /reload in chat. If you see "IT WORKS!" appear in chat, you can remove the line we added in step 4 and continue.

Note that each tag file you just edited already has a function file linked. Use the tick, load, register_options and uninstall function files inside <your namespace>/functions/pmclb to run certain commands on tick (20 times a second), load (after /reload), registration or uninstall respectively. The registration function will contain the necessary commands to register your implementations for use by the framework. Creating a new option will be explained in "Custom Content" section below .

Before
data/

data/bertiecrafter/tags/functions/pmclb/load.json (do the same for other files in that folder)



After

data/

data/bertiecrafter/tags/functions/pmclb/load.json (do the same for other files in that folder)
image


Custom Content: Use your imagination to make something happen!


When a lucky block gets activated, a random option from the list of registered options will be picked and executed. All you have to do is register the option and implement it. You can repeat this step for as many options as you want.

1) Start by going into <your namespace>/functions/pmclb and open up register_options.mcfunction. Copy the template command down and make sure to remove the hashtag in front of the copied line. Fill in the title of the option, your (user)name and the function command that serves as entry point. Keep in mind that the title and author name will be publicly visible.

2) Create the function file you indicated as entry point in the command above. Simply put "say Hello World!" into the file, run the /reload command and run "/function bertiecrafter:pmclb/break/activate". If you see "Hello World!" appear in chat after you broke one, you successfully added an option!

3) Now you just have to properly implement it. Note that you can always directly run the option by copying the /function command from the register_options.mcfunction into chat. Just make sure the options are still properly linked by testing the options through actual lucky blocks or the activate command before submitting.

4) Useful commands:
/function bertiecrafter:pmclb/give/lucky_block: Give the nearest player a lucky block.
/execute as <players> run function bertiecrafter:pmclb/give/lucky_block: Give all selected players a lucky block.
/function bertiecrafter:pmclb/spawn/setblock: Place a lucky block in the current location.
/execute positioned <coordinates> run function bertiecrafter:pmclb/spawn/setblock: Place a lucky block at specified position.
/execute at <players> run function bertiecrafter:pmclb/spawn/setblock: Place a lucky block at the feet of selected players.
/function bertiecrafter:pmclb/break/activate: Simulate a lucky block being broken at the current location.
/execute positioned ~ ~1 ~ run function bertiecrafter:pmclb/break/activate: Simulate a lucky block being broken 1 block above the current location. Can be placed in a command block for quick testing.

Note that you must run /reload after every datapack edit.

Before

data/your-username/functions/pmclb/register_options.mcfunction

data/your-username/functions/pmclb/




After

data/your-username/functions/pmclb/register_options.mcfunction

data/your-username/functions/pmclb/

data/your-username/functions/pmclb/my_epic_option.mcfunction




Submission

You can never test enough. Make sure that the option registration is set up right and that every option still works when integrated with the framework, since you might have been testing with directly running the function command. Read the rules again and when you're satisfied with your submission, upload it to Planet Minecraft. Regardless of whether or not you get to contribute, we hope you had a blast creating anything you could come up with and maybe you even learned something from this event.


Need help?
If you need help the framework setup, feel free to ask questions below. If you need help implementing your custom idea into the block, we strongly encourage you to follow this Minecraft data pack tutorial series as well as view it's references. You can of course ask questions but many of them are already answered online with a little bit of research. Good luck and looking forward to seeing the event unfold!

Thank you for participating!
Posted by Bertiecrafter's Avatar
Bertiecrafter
Retired Moderator
Level 70 : Legendary Engineer
773

Create an account or sign in to comment.

77

3
06/06/2020 10:09 pm
Level 9 : Apprentice Goblin
MASTRIO
MASTRIO's Avatar
Could I make the lucky block have a chance to summon a custom mini boss or would that be too involved?
I'm not sure if I can because then the player would then have to fight the boss instead of just moving on and breaking another lucky block.
I would make the bosses drop cool loot though :/
3
06/07/2020 3:39 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
The main guideline with these questions is: "Would it still be fun to play?"

Mini bosses should be fine, but give players a chance to run away and move on if they don't feel like fighting it.
2
06/08/2020 6:03 am
Level 9 : Apprentice Goblin
MASTRIO
MASTRIO's Avatar
Ok cool, I'll make the options create a tiny structure that allows you to spawn the mini boss if the player wants to.
Thanks! :)
3
06/06/2020 11:22 pmhistory
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
May I summon NoAI withers? They fill the area but not require you to kill them.

May my data pack require a resource pack?

May I invent a strange effect and give it to the player to a certain amount of time (using /bossbar to show the duration)?
2
06/07/2020 3:44 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
May I summon NoAI withers? They fill the area but not require you to kill them.
Not sure why, but sure :P

May my data pack require a resource pack?
Unfortunately not, it's already quite difficult to ensure uniqueness in the datapack and resource packs make combining entries just impossible.
May I invent a strange effect and give it to the player to a certain amount of time (using /bossbar to show the duration)?

Yes, but make sure you make the bossbar id truly unique. They can have namespaces, so create one that looks like '<your-namespace>:<my-unique-name' with the namespace matching the personal folder name. (The one that was called "steve" originally). Also depending on how negative the effect is, make sure it stays fun... If most players would rather kill themselves than wait it out, your effect is probably too long.
1
06/07/2020 10:36 am
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
OK, thanks. I don't see the problem in resource packs. If every user uses a random CustomModelData, the chances to have two same numbers on the same item are almost 0. But okay, I guess a villager nose with curse of binding is not an option :)
1
06/07/2020 11:34 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Yeah did think about that, but as far as I know setting the textures for CustomModelData is in the same JSON file as many other powerful options and it would be too much work to open up every technical file to see if people only modified textures for CustomModelData. Also most people would not put effort into picking a unique number, with plenty of numbers <10 and collisions as a result. Hopefully you can still compose something nice from other Minecraft elements =)
3
06/07/2020 12:35 am
Level 60 : High Grandmaster Mage
craftdiamonds
craftdiamonds's Avatar
2
06/07/2020 4:36 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Question copied from the Framework Data Pack submission by UltroGhast:
Can't we just create a datapack by scratch in our own way?

Nope. We want to be able to combine submissions into one big lucky blocks datapack at the end. This is only possible if everyone has the same connection points, so we can simply hook everyone into the system without having to know how the datapacks work. The framework provides you with these (for this event) standardized connection points that allow multiple datapacks to be merged together as long as they all use a unique namespace.

Make sure to read the rules for additional information about what is and what isn't allowed. Of course, all of this only applies to this event. Feel free to create your own lucky block datapack that does not use the framework, but also can't be submitted to the event.

Also, I do realize the list of instructions above might seem daunting to some, but I can assure you it's way easier than having to implement everything the framework has to offer yourself.
1
06/07/2020 4:44 am
Level 68 : High Grandmaster Engineer
UltroGhast
UltroGhast's Avatar
Not really. There are people like me who can work only with their template framework, but there are also people who can mix datapacks into one.
2
06/07/2020 5:15 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Sorry, but you'll have to adjust any framework/re-used function to fit within the given framework, within your own namespace. If you do copy functions over, pay close attention to making everything globally unique. That usually involves prefixing scoreboard objectives, tags, teams, bossbars, etc. with some kind of short code to distinguish your section from the others.
Ensuring that any player can submit any datapack that works nicely with any other datapack is a lot more difficult than combining a couple datapacks you know the ins and outs of. Especially if you want to ensure scalability, manually figuring each submission out and tracing which functions call what and when becomes almost undoable after a handful of them.
1
06/07/2020 12:39 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
Structures are alowed, right? Of course with the namespace and everything.
1
06/07/2020 1:12 pmhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Yeah, just stay within your namespace (don't override minecraft structures). Also, please add another folder "pmclb" within the structures folder before placing any structure files. This allows one_nose:pmclb/tower to be distinguished from one_nose:another_cool_data_pack/tower.
2
06/07/2020 1:36 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
Okay, thanks.
1
06/07/2020 1:02 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
I have found a bug in the framework. The command block removes any block you put in ~ ~ ~, so you must use /schedule to place a block in there. I recommend removing the command block and replace it with something else, like an invisible armor stand with tag that automatically run the command and dies. The command doesn't seem to be necessary at all.
1
06/07/2020 1:15 pmhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Perhaps you could PM me with more details? How is this a bug, since you want the block to be overridden by a lucky block in the end anyways and how does /schedule fix anything? The command block is necessary to make any text you enter in register_options.mcfunction executable. I might be able to use command block minecarts, but I'd need a reason for why command blocks are not an option and I'd have to further investigate if it's really possible. Just send me a message!
3
06/07/2020 1:24 pmhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Oh I think I get what you mean... If the framework launches the command inside, which sets the current block it will then be replaced by air. The problem is in activation, not in placing the lucky block.
Simply replacing air only if the current block is a command block should do the trick.
FIXED! Please redownload the framework :P
1
06/07/2020 1:38 pm
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
I think the problem is the setblock of the command block, not the air. A command block minecart will solve it.
2
06/08/2020 12:09 am
Level 76 : Legendary Programmer
legopitstop
legopitstop's Avatar
Found a new bug kills all nearby dropped items when broken. within 2 blocks

Fix/issue location: bertiecrafter/functions/pmclb/break/activate.mcfunction
command that is causing issue:
kill @e[type=item,distance=..2]

Fixed command, kills player head item & shortened the kill radius to 0.5:
kill @e[type=item,distance=..0.5,nbt={Item:{id:"minecraft:player_head"}}]]
1
06/08/2020 12:42 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Thank you for reporting, will work on a fix right away!
1
06/08/2020 2:13 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Fixed!
1
06/08/2020 10:56 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
This sounds dumb, but this is my first time in an event and I don't know how to submit it. I know how to create a data pack post, but I don't know how to make it count as a submission for the event. Can you show me how? Thanks!
1
06/09/2020 3:26 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
There should be a checkbox on the data pack submission page under "Publish live" that indicates it'll be submitted. Note that you can only submit once. Read the rules and the deadline is still far away. Perhaps you want to take the time to add more options, totally up to you though =)
1
06/09/2020 8:04 am
Level 57 : Grandmaster Hero
One_Nose
One_Nose's Avatar
In this link, click Submit entry.
3
06/09/2020 12:05 am
Level 61 : High Grandmaster Imposter
The ExiIed FeIIow
The ExiIed FeIIow's Avatar
Can I add a boss fight to my pack? (Don’t worry, I’m using your framework)
2
06/09/2020 3:28 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
This was already asked, just keep it fun and make sure players can move on to the next lucky block if they want to. Another user decided to spawn some kind of activation mechanism that gives players the choise of spawning it. This allows the amount of required interaction to stay low, while the actual boss can be in depth.

This is not required though, you can also just spawn the mob directly and allow players to run away :P
2
06/09/2020 4:14 am
Level 61 : High Grandmaster Imposter
The ExiIed FeIIow
The ExiIed FeIIow's Avatar
Alright.



(How the boss spawns is by summoning it. You need four "Mysterious Fragments" from the "Boss Fragment" lucky block event. There are four different types. Once you got all four, throw all of them on the ground and the fight begins.)
3
06/09/2020 1:24 am
Level 73 : Legendary Blacksmith
Enders Host
Enders Host's Avatar
Hi, I was just wondering how many options the lucky block needs? I've got about five or so, at the moment but I'm not sure how many more ideas I can come up with that are actually good.
Should I keep it 100% good additions, or should I add some filler and junk, like small rewards and random stuff that other people have probably already done?
2
06/09/2020 3:31 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
As said in the rules:
A submission can have multiple options (lucky block implementations), but keep in mind that it's all-or-nothing when it comes down to being accepted into the final data pack. We rather see fewer high-quality options than a ton of quick and dirty options.

Unfortunately I can't give you an optimal amount of options. It's best to keep them of high quality and submit less options if you can't come up with more :p
2
06/09/2020 5:40 am
Level 73 : Legendary Blacksmith
Enders Host
Enders Host's Avatar
Thanks, I just wasn't sure if I needed to make a full pack of just the important parts, the post was a bit vague about that.
1
06/09/2020 4:26 am
Level 39 : Artisan uwu
Magneter102
Magneter102's Avatar
Could I have the name of the option as something like "???" or "??? Chest", if I wanted to make an option for a trapped chest and an option for a normal chest, and have the player not know which one it is?
1
06/09/2020 5:48 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Yes, there are no restrictions on what you put in the title and author slots, as long as you follow PMC rules on language and submission content.
2
06/10/2020 12:18 pm
Level 10 : Journeyman Engineer
SheepCommander
SheepCommander's Avatar
I want to participate, do I need to use my username or can I use my capitals "sc", as that's what I usually use.
1
06/10/2020 3:17 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
It's best to use your full username as namespace, but feel free to use the short version for prefixes on objectives, tags, teams, bossbars, etc.
3
06/10/2020 12:25 pm
Level 10 : Journeyman Engineer
SheepCommander
SheepCommander's Avatar
Still think it's pretty cool that there's an official datapack thing (too bad my creative block will probably prevent me from even doing anything)
2
06/10/2020 2:25 pmhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Lucky Block Event Update

I just reviewed the first submissions and I came across something I didn't think of, but will be added to the rules soon:

warning You're only allowed to take visible actions in option implementations. This means that tick, load, uninstall and register_options functions should not output chat messages, sounds or anything of the kind.

Also a friendly reminder to really try and make all globaly unique items (scoreboard objectives, teams, bossbars, tags, etc) actually globally unique. This usually involves adding prefixes to those names based on your namespace.
1
06/11/2020 1:50 am
Level 39 : Artisan uwu
Magneter102
Magneter102's Avatar
Why though? Chat messages, and more so sounds, can be rather useful :/
3
06/11/2020 3:31 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
You can still use all of the listed elements in your own functions when a lucky block gets broken or to make spawned creations a little cooler with sounds and particles!

Just ensure you stay invisible until it's your time to shine =) So don't make anything visible happen in load, uninstall, tick and register_options functions.
2
06/11/2020 9:20 am
Level 39 : Artisan uwu
Magneter102
Magneter102's Avatar
Aah, alright, seems I have simply misunderstood you, sorry for that.
2
06/11/2020 9:58 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
It's fine to ask anyways. There might have been more people questioning the same thing.
1
06/11/2020 2:15 am
Level 39 : Artisan uwu
Magneter102
Magneter102's Avatar
Also, what does "anything of the kind" mean? Would particles fall under that too for example? And if so, what wouldn't fall under it, at that point?
1
06/11/2020 3:27 am
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Yes, particles too.
register_options must only be used to copy the template commands for new options.
tick should only be used to track spawned creations and modify them or nearby players based on certain conditions. If you want a created entity to show particles near a player, you can do that.
load/uninstall should only set up or remove scoreboard objectives, bossbars, teams, etc.

The rule is mainly in place to prevent visible output that is unrelated to a chosen option, like a message in chat after /reload.
2
06/11/2020 5:10 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
So if I have a custom item that does something having to do with sound/chat, and that something is executed through the tick function, that’s allowed right?
1
06/11/2020 5:28 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Yup, you got it!
2
06/10/2020 3:15 pm
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
Lucky Block Framework Update
Apparently the submissions are a lot more sophisticated than I had expected, so the register_options template command now allows to specify more information that can be used to explain how structures work, give hints, explain what a player needs to do to solve a mystery, etc.
The new template command is:
data modify storage bertiecrafter:pmclb options append value {title:"<title>",author:"<name>",function:"/function <namespace>:pmclb/<path-to-function>",info:"<Extra info or blank>"} Note that this new version is backwards compatible, so you do not need to add the "info" tag to already existing option registrations.
2
06/11/2020 5:11 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
you can place the spawn eggs in spawners and you get free armor stands. lol
1
06/11/2020 5:30 pmhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
A fun little easter egg I suppose XD
Send me a video of your armor stand farm haha
2
06/11/2020 9:15 pm
Level 49 : Master Crafter
NTDan
NTDan's Avatar
I mean if you want to leave it there, you can, but there's a more polished way to do this. You could give the player the exact same skull item, but with a special tag like "{luckyBlock:1}" and then only detects items that do NOT have that tag. That will fix the spawner bug but more importantly, give the player the actual skull, and it looks nicer than a zombie egg and gives the player a hint of what the lucky block looks like.
1
06/12/2020 3:14 amhistory
Level 70 : Legendary Engineer
Bertiecrafter
Bertiecrafter's Avatar
For a long time I deemed this impossible, because tags disappear when you place the block and I preferred spawn eggs over having to drop the item on the ground. Only recently I published an update where lucky blocks don't have armor stands sitting at the lucky block to track it being broken any more and I didn't realise that means skull items can be used directly.

Will fix soon =)
EDIT: Fixed
2
06/12/2020 9:09 am
Level 49 : Master Crafter
NTDan
NTDan's Avatar
Theoretically, if you were still using the armor stand method, you could use a fill command that fills a square around the player that replaces skulls with that specific skin with a command block. That looks not so nice though. Or you could’ve done a different method: detecting each individual skull block around the player and summon an invisible armor stand on those that doesn’t have it. But both of the methods require a little bit too much effort and aren’t worth it for a lucky block data pack. But thanks to the detection optimization, the placement method can also be optimized :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome