How to Add Custom Blocks to Minecraft Datapack Tutorial
Vložit
- čas přidán 14. 06. 2024
- Loot Table Generator:
misode.github.io/loot-table/
Download the tutorial datapack:
www.dropbox.com/scl/fi/qbwhf4...
Download the Tutorial resource pack:
www.dropbox.com/scl/fi/uvp81e...
Discord Link:
/ discord
Join our Patron server by supporting us on Patreon:
Get exclusive datapack updates and entire packs.
/ wasd_build_team
Learn about all the donation perks:
wasdbuildteam.website/donate/
*My Favorite Minecraft Server Host*
bisecthosting.com/WASD
Use Code "WASD" for 25% off your first month!
Chapters
00:00 - Intro
0:59 - Context
3:09 - Step 1
6:58 - Step 2
20:39 - Step 3
29:11 - Outro - Hry
For a while i made simple mods with not much coding but after a while i decided to make datapacks. And to be honest in some cases datapack creators deserve much more respect than mod creators because of the toughness of even adding a new block to the game. Sadly i had to give up both making mods and datapacks because my laptop broke and then when i got a new one i had lost my account lol
Honestly Iʼm considering turning my data pack into a mod but I *think* at this point that would be more effort. Not sure, though.
@@danielrhouck just package it into a mod with modrinth. that simple!
@@jqmth I mean so it can use custom blocks and items
@@danielrhouck I can't seem my actual comment. I don't remember what i said lol
@@jqmth I can’t either anymore, weird.
You said to just package the data pack as a mod, which can solve some issues but doesn’t help with data packs having limited tools to work with.
Adding a custom item : 😃
Adding a custom block : 🙁
Adding a custom entity : 💀
LOL, yes
It's fortunate fro you to upload this recently since I started getting back to making mods/datapacks. Awesome video!
Honestly same, I've been scratching me head watching outdated tutorials trying to make them work, I've figured out pretty much everything from recipes to UI, but can't for the life of me figure out custom blocks😂
Got this working in 1.20.5 prerelease 1! Had to port some item nbt to components of course, but ran into some other quirks too. Notably, item frames are no longer placed in the middle of a block, their position is actually in the wall of the block. Easily fixed with execute align tho! Also managed to get rotatable blocks by checking the y_rotation of the item frame, and fixed an issue that can happen with core blocks that aren't fully solid (slabs, end rods, brewing stands, etc.) with these two lines at the top of place.mcfunction:
execute if block ~ ~ ~ end_rod run function paccagl.block:block_test/break
execute if block ~ ~ ~ end_rod run return fail
just checks if the block already exists, and prevents placement. Avoids accidentally destroying vanilla blocks, or infinitely stacking custom blocks on a single block.
Great tutorial! I feel like I know how everything works, which is great cause now I can expand on it like this :D
Nice!
For the item frame rotation, I found the formatting of the components to be a bit odd. It is still possible to do.
I'm surprised I didn't include that fix for nonfull blocks, as I have that code for all the custom blocks I've made.
misode me **** myself with the april fools demo timer. I actually thought man switched to a payment now
Now I can finally make my favorite coe block 🔥
I KNEW someone would finally use Item Displays to make custom blocks. I'm so happy that you did it.
This is a great tutorial, I was struggling to figure out how this all works. You go through some of the resource pack stuff kind of fast though, it would be nice to also be provided with the resource pack. For example, I'd like to be able to fully copy the json for the block so I don't have to try and do it myself. Also, I'm not sure if I'm supposed to put custom model data in the block json.
All the model/resource pack stuff was covered in a previous tutorial.
I should definitely include that template resource pack, I'll do that.
Thank you very much for these tutorials, helped me out a ton! Also is there any reliable method for checking for blocks in line of sight(that blue line in hitbox)? Something like raycast or idk?
Not particularly reliable...
I have a couple functions for that in my library if you are interested. Util/looking_at_block. Very very simple concept.
@@WASDBuildTeam Def gonna look at them, at this point anything is better then jank like spawning 7 interactions, then all of them checking for blocks, and failing to execute command due to it executing as @s but not the player that did the raycast lol.
you only need to check for the block once every 2 ticks, 1 tick is too much, 3 tick may allow the user to get the original loot from the block
so you can use a function that schedule itself every 2 ticks
also what I personnaly like to do is to test if I can kill the item before spawning the item, that way I can chose the block depending on the tool I want the user to use + player in creative don't get the item when breaking it so it doesn't fill their inventory
I cant believe your videos are so useful but no one leaves a like. You don't deserve less than 1k likes. I am making a datapack and you are making me learn so much. You gained yourself a sub... :)
cool tutorial
there's a solution for having both a specific block and having it light like it should, it's to have the item display 1 block above it and to use the translation tag to move the visible part where we want, however this does work really well for stuff like crafter but it doesn't work for stuff like decorative block as the block above/on the side will surely be filled with another block
Indeed. All my Crafters use this, but because it is kinda specific I chose to not cover it
@@WASDBuildTeamI feel like alot of people would really like having any type of block as their block.
So, two questions:
1. I havenʼt tried this in-game yet so I might be wrong, but if youʼre in survival, wonʼt this give you the red stained glass *and* the red emerald block if you break it?
2. I want a block that does something on interaction. If the desired interaction were to open a GUI the solution wuold be to make the underlying block a barrel, but I want something custom instead. My first thought was an interaction entity, but that wouldnʼt work right because it would prevent breaking the underlying block. Would the way to do this be again an `item_used_on_block` advancement? Is there a way to have it not trigger if instead that was placing a block or entity, only if someone is actually using the block?
For 2, is there a block *other than a note block* which is at least mostly a full block and changes state but does not open a GUI when right-clicked? That seems like the best bet. (I donʼt even mind if itʼs an opaque block with the weird lighting issues; I just donʼt want it playing notes, and I do want people to be able to interact with it from above so putting carpet on it doesnʼt help)
EDIT: Okay, the note block with a light block on top works; I didnʼt expect it to. Not ideal (because solid and because Iʼd prefer a pickaxe-breakable block) but probably the best I can get unless thereʼs some sort of clever interaction entity trick or something)
1. On break, I have it kill the dropped red_glass (if it dropped).
2. Custom GUI isn't possible. Though it sounds like you are wanting it to do something on right-click. Funny enough I made a pack using interaction entities for blocks. Exactly what you said is the issue, is the issue, but you can make it so that on left-click it breaks. It won't have a mining animation and such but totally viable in my opinion.
@@WASDBuildTeam I didn’t mean custom GUI windows, but something based on `tellraw` and then clicking chat components to run `/trigger`. And I had meant to check out your machines pack but it slipped my mind; I’ll do it tomorrow.
I think I prefer the note block method for my thing because I don’t want one accidental punch to break things. Although you could implement the important parts of the block damage system to both take time and work faster with the right tool… I’ll sleep on that.
It would be really convenient if I could place my custom block on top of a redstone torch. The top face of a torch can’t support item frames or of course paintings, and every other entity I can think of that’s spawnable from an item goes inside the torch (even shulker spawn eggs, which manage to do some other edge case placements correctly) or has other obvious issues.
Is there a standard solution if a block needs to handle edge case placement rules? My current thought is to place a block entity with custom NBT and somehow detect that, but that is harder than detecting an entity and I feel like someone else must have solved this problem even if I can’t find out how.
@@danielrhouck That of course isn't something we can modify with a datapack. But yeah, would be nice to have that control
Uh admin you know the how to make the custom item video but what i want to know is that how do i make my own items with my custom item
Hey WSAD I don’t know what I did wrong, but the item display won’t spawn. I even downloaded your pack, and it is still not working. Love your Tutorials!
I think we solved this on the discord. It was just Lunar Client breaking things
Yea. I forgot to delete the comment or rather edit it so that other people who have this problem know.
How to add a second block into the datapack?
I figured it out.
How to detect if a block gets placed in a datapack?
Also maybe it has CustomModelData.
That is what this tutorial is
how to change the texture?
That was covered in the tutorial and the one before it.
@@WASDBuildTeam when? I warched it several times but I cant find it.
@@tomar-ec4fc 5:00
I say quite a few times though to check out the Custom Items tutorial because it has a more in depth explanation.
You made a sword tutorial, when would a bow tutorial come? Or just no.
It is on my very long todo list for tutorials. Probably gonna be Pickaxes/Axes/Shovels before it though (all one tutorial)
Seems good.
i think it would be beter if yo bade sure the player is not in creative then summon the item
True, though that requires knowing which player broke the block, which isn't really something that can be easily determined.
What is 1b
the 1, is a 1.
The b specifies the data type is a byte.
Yes... totally red.
how to add armor?
Armor ITEMS can be made using this method, but the texture you wear needs a different method to change. One that I don't have a tutorial on.
@@WASDBuildTeam if you made such a guide it would surely be useful to a large number of people
@@FledRychu I would need to learn how to do it first xD
Hey WASD I hope you are free at the moment,you seem like a great datapck creator and I was hoping if you would want to help me make a unique minecraft datapack.
I don't currently take commissions, but thanks for the interest!
Okay thank you for the reply,do you know any other datapack creators in the community?