How to Add Custom Blocks to Minecraft Datapack Tutorial

Sdílet
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

Komentáře • 66

  • @RaxoNCS
    @RaxoNCS Před 5 měsíci +22

    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

    • @danielrhouck
      @danielrhouck Před 3 měsíci +1

      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.

    • @jqmth
      @jqmth Před 2 měsíci

      @@danielrhouck just package it into a mod with modrinth. that simple!

    • @danielrhouck
      @danielrhouck Před 2 měsíci

      @@jqmth I mean so it can use custom blocks and items

    • @jqmth
      @jqmth Před 2 měsíci

      @@danielrhouck I can't seem my actual comment. I don't remember what i said lol

    • @danielrhouck
      @danielrhouck Před 2 měsíci

      @@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.

  • @NaClbs
    @NaClbs Před měsícem +5

    Adding a custom item : 😃
    Adding a custom block : 🙁
    Adding a custom entity : 💀

  • @5uperM
    @5uperM Před 5 měsíci +3

    It's fortunate fro you to upload this recently since I started getting back to making mods/datapacks. Awesome video!

    • @unknowncontender4012
      @unknowncontender4012 Před 5 měsíci +1

      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😂

  • @Pacca64
    @Pacca64 Před 2 měsíci +1

    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

    • @WASDBuildTeam
      @WASDBuildTeam  Před 2 měsíci +2

      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.

  • @jqmth
    @jqmth Před 2 měsíci +3

    misode me **** myself with the april fools demo timer. I actually thought man switched to a payment now

  • @iamabotatgameyt9822
    @iamabotatgameyt9822 Před 5 měsíci +1

    Now I can finally make my favorite coe block 🔥

  • @5uperM
    @5uperM Před 5 měsíci +2

    I KNEW someone would finally use Item Displays to make custom blocks. I'm so happy that you did it.

  • @Ubspy
    @Ubspy Před 5 měsíci +1

    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.

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci

      All the model/resource pack stuff was covered in a previous tutorial.
      I should definitely include that template resource pack, I'll do that.

  • @veruty228
    @veruty228 Před 5 měsíci +2

    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?

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci +2

      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.

    • @veruty228
      @veruty228 Před 5 měsíci +1

      ​@@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.

  • @Rignchen
    @Rignchen Před 5 měsíci

    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

  • @Some_dude_Somewhere
    @Some_dude_Somewhere Před 2 měsíci +1

    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... :)

  • @TheAssassin000
    @TheAssassin000 Před 5 měsíci

    cool tutorial

  • @Rignchen
    @Rignchen Před 5 měsíci

    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

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci +1

      Indeed. All my Crafters use this, but because it is kinda specific I chose to not cover it

    • @Pete675u
      @Pete675u Před 3 měsíci

      ​@@WASDBuildTeamI feel like alot of people would really like having any type of block as their block.

  • @danielrhouck
    @danielrhouck Před 3 měsíci

    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?

    • @danielrhouck
      @danielrhouck Před 3 měsíci

      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)

    • @WASDBuildTeam
      @WASDBuildTeam  Před 3 měsíci

      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.

    • @danielrhouck
      @danielrhouck Před 3 měsíci

      @@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.

    • @danielrhouck
      @danielrhouck Před 3 měsíci

      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.

    • @WASDBuildTeam
      @WASDBuildTeam  Před 3 měsíci

      @@danielrhouck That of course isn't something we can modify with a datapack. But yeah, would be nice to have that control

  • @user-mb7if9ok8b
    @user-mb7if9ok8b Před 5 měsíci

    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

  • @meerhornisse283
    @meerhornisse283 Před 2 měsíci

    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!

    • @WASDBuildTeam
      @WASDBuildTeam  Před 2 měsíci +1

      I think we solved this on the discord. It was just Lunar Client breaking things

    • @meerhornisse283
      @meerhornisse283 Před 2 měsíci

      Yea. I forgot to delete the comment or rather edit it so that other people who have this problem know.

  • @alexanderscozydesk
    @alexanderscozydesk Před 2 měsíci

    How to add a second block into the datapack?

  • @Walker__91
    @Walker__91 Před 5 měsíci

    How to detect if a block gets placed in a datapack?

  • @tomar-ec4fc
    @tomar-ec4fc Před 3 měsíci +1

    how to change the texture?

    • @WASDBuildTeam
      @WASDBuildTeam  Před 3 měsíci

      That was covered in the tutorial and the one before it.

    • @tomar-ec4fc
      @tomar-ec4fc Před 2 měsíci

      @@WASDBuildTeam when? I warched it several times but I cant find it.

    • @WASDBuildTeam
      @WASDBuildTeam  Před 2 měsíci

      @@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.

  • @Walker__91
    @Walker__91 Před 5 měsíci

    You made a sword tutorial, when would a bow tutorial come? Or just no.

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci

      It is on my very long todo list for tutorials. Probably gonna be Pickaxes/Axes/Shovels before it though (all one tutorial)

    • @Walker__91
      @Walker__91 Před 5 měsíci

      Seems good.

  • @samantharaker2469
    @samantharaker2469 Před 9 dny

    i think it would be beter if yo bade sure the player is not in creative then summon the item

    • @WASDBuildTeam
      @WASDBuildTeam  Před 9 dny

      True, though that requires knowing which player broke the block, which isn't really something that can be easily determined.

  • @Proxypp
    @Proxypp Před měsícem

    What is 1b

    • @WASDBuildTeam
      @WASDBuildTeam  Před měsícem +1

      the 1, is a 1.
      The b specifies the data type is a byte.

  • @Walker__91
    @Walker__91 Před 5 měsíci

    Yes... totally red.

  • @FledRychu
    @FledRychu Před 5 měsíci

    how to add armor?

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci

      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.

    • @FledRychu
      @FledRychu Před 5 měsíci

      @@WASDBuildTeam if you made such a guide it would surely be useful to a large number of people

    • @WASDBuildTeam
      @WASDBuildTeam  Před 5 měsíci +1

      @@FledRychu I would need to learn how to do it first xD

  • @djak6133
    @djak6133 Před 4 měsíci

    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.

    • @WASDBuildTeam
      @WASDBuildTeam  Před 4 měsíci +1

      I don't currently take commissions, but thanks for the interest!

    • @djak6133
      @djak6133 Před 4 měsíci

      Okay thank you for the reply,do you know any other datapack creators in the community?