What’s going on guys Super 9 and welcome to how to make a custom weapon in Minecraft this is going to be a small tutorial Series where we’re going to be diving in on how to make a custom weapon and in today’s video we’re going to code This thing out and talk about some hit detection as you can see here all right so here we are inside of a VSS code now I’ve already gone ahead and gone into the data P folder where the world file is and have created this folder called Weapons Chach you should know how to do this from the previous tutorial so we’re not going to um be going into that it’s pretty straightforward so with that said we need to start this bad boy off by doing a file like so and we are going to Call this one pack. MC meta This is highly important and inside of pack. MC meta we are going to set it up like this we’re going to have curly bracket and then we are going to do quotations we’re going to type pack and then we’re going to do the Colon space this over we need curly brackets again hit enter and then quotations pack uncore format like so and colon and then 15 because we are in Minecraft 120 so then um make sure you put the comma hit enter quotations again description and colon and then this can Just be whatever we’re just going to say weapons cache all right there we go so then that is that now the other important thing that we need to do is make sure that this is highlighted again and we are going to create another fold in here and this one is going to be Called Data now inside of data we are going to make sure that this is selected again create another folder it needs to be subfolder as you see how it dropped right here it needs to go to Minecraft and then we need another folder this needs to be sub folder inside of Minecraft we’re going to call this one tags and then again make sure that this is underlined we need another folder and then this one is called functions so I showed how to set this stuff up in the original data pack video if you want to check that out link is going to be Popping up somewhere on the screen also I do want to shout out that all of the data packs that I do make for tutorial series are available in my Discord links located in the description below definitely head over there and follow us and uh you can find this in the chat That is called data pack downloads all right so with that said now inside of the functions folder we want to make sure that this is underline we’re going to create two files we’re going to create load. Json in tick. Json so let me do that real quick all right so after Those two files are created what we need to do is hit the curly brackets like so and then we are going to do quotations and type in values hit the arrow and then put in a colon space that over hit brackets and then quotations and then we are going to do weapons uncore CH colon load because we’re in the load Json file and we should be good to go with that so good to go now what we’re going to do is copy this and paste it over here into the tick. Json the only thing we have to Change is down here on load it needs to be tick like so we are going to save all of this stuff and now we can start moving into building the cool stuff all right so moving forward what we want to make sure is data is underlined we’re Going to create a new folder and then this one is going to be weapons Chach in my case you can name this whatever you want so let me make sure that that is underline folder and we’re just going to paste this in like so I missed the w we Need to make sure spelling is correct it needs to match this this is how the Minecraft is basically going to be like okay I need to load this this folder all the stuff that’s inside of it uh and this is how we’re going to do all of our Our cool stuff so inside of this folder we’re going to have a lot going on this is where the magic is going to happen with that said we are going to start with some of the simpler things first and then move into the hit detection so To begin with that we are going to make sure that this is highlighted and we are going to create a new folder we are going to call this one functions and and inside of functions we’re going to do quite a bit we’re going to start with a New file we’re going to make sure functions underline and let’s start with load MC function and then underlying functions again we’re going to hit file or yeah create new file and then tick. MC function like so we’ve got these two these are vitally important so inside of The load. MC function what we can put is basically a message so that every time that we reload we know the hack has loaded correctly so we’re just going to copy this line of code and paste it in we went over this in the beginning tutorials where I showed you how to make A data pack I believe so this is all you need for this nothing special basically every time that this pack gets loaded it’s going to Output this message in chat with this color and this is heximal color so you can change this to whatever you want but I think this one is just Set to Blue I remember right don’t hold me that so with all that done what we need to do now is set up a give function for us so that we can run this give command inside of the game to get the sword that we are basically manipulating so with That said we need to make sure that functions is underlined again we’re going to create a new file and this one is just going to be called give. MC function this should look for familiar from previous tutorials like so there we go and now all we need to do is basically input the Sword here now you can do this with mcstacker Donnet I’ve shown how to create the I believe it was the bacon bow on there so you can follow along with that tutorial and stuff I’ll have a link located in the description below as well if you want to generate yourself a Sword but I have one already made so I’m going to copy and paste this command line in and what I’m going to do for good practice because this may hold multiple swords in the future I’m not sure exactly what we’re going to be doing uh over the long term here I’m Going to just call this sword one so we’re just going to make a note so that we know that this is sword one so we have copied this in and this is just a simple give command I’m giving myself a netherite sword I have changed the display name to bacon sword and it’s Just the lore tastes like bacon got some custom model data this is also going to be important uh to when we’re running checks for the mob hit and things so you can also set this an MC stacker and then here’s all the enchantments at the end here and uh That’s pretty much it and then this is just giving me one of this item so that’s all this line is really telling you here um nothing too crazy Z over the top but like I said you can completely generate this line in MC stacker all Right so now that we have that done what we’re going to do is create a folder that’s going to hold all the different types of swords this is good practice just in case you are trying to make a data pack that you’re going to have multiple different types of weapons you Can create different folders for them etc etc so that’s what we’re going to be doing here going to make sure that functions is underlined we’re going to create a folder here and we’re just going to Simply need them this one in our case swords so inside of Swords just To keep the naming convention the same what I’m going to do is create a file that’s going to be in another MC function I’m going to name this sword 1. MC function and inside of here this is where the Magic’s going to happen for the sword so like the bacon bow we kind Of manipulated some of that stuff we can do similar things here so inside of here we’re going to do good practices and do hashtag and handles abilities abilities for sword one awesome so then this way if we go away revisit this data pack in the future we Know exactly what is going on here and uh we can just remind ourselves so what I’m going to do is this is where we’re going to paste in all of the swords special abilities where we’ve got particle effects etc etc I have some of these off to the side here so I’m just Going to copy and paste these in now you can manipulate these in any way shape or form that you want you can change the particle effects like if we wanted to add another particle effect we just do particle and then tab that over and then Uh when you space over with tab it will give you all of these different huge lists of things that you can do so you can sit there and play around with all of this stuff so what this is basically doing here inside of our file is we’ve Got a particle flame here this is the X Y and Z axis so it’s basically spawning on the the mob or the hit Area I guess you could say uh in this manner so we’ve got that we’ve got a particle campfire smoke because it’s just a big mass of Smoke and then we’ve got a play sound so you can actually do different sounds so you can play with Minecraft sounds in here uh as well so you can do play sound like so tab that over and when you do that look at all of this stuff that you Can totally access so you can sit here and play with all of the different things um and get anything manipulated the way that you would like so then we have the particle Sonic Boom so that will play there as well same thing with the location X Y and Z axis and then we Have the effect where we are going to give the mob a levitation uh as well so that’s going to be pretty cool all right so the next thing since we’re inside of here this is going to be for our future stuffs is we’re going to do hashtag and then tagging Entity uh hit by sword there we go so then we are going to type out this line here it’s going to be tag going to hit tab with that move over we’re going to do at s hit enter and then space that over we’re going to get add there so we’re going to Hit enter on that and then we are going to name this this can be whatever you would like I’m just going to name it uh hitor by sword just to keep it simple for future when we decide to come back and mess with this thing it doesn’t have To be exactly this this is just the tag you’re going to be referencing this tag later so you have to remember essentially what you have named this here all right so I’ve jumped back into Minecraft to test this thing out make sure everything’s working up into the Point that we are at currently with that said we’re going to do SL function and then we’re going to do space and you should see something like this we’ve got weapons TRS colon give we’re going to tab that thing boom and we’ve got the bacon sword let’s check to make sure the Enchantments are on here everything seems to be good to go now what you can do is theoretically leave it as this it will work so as you can see when we do this and then hit we have all those special effects that we we coded in Working now uh the reason why you want to do hit detection though is some mobs and uh entities will not be affected by the sword I don’t know why that is it’s Minecraft being weird but that’s where this hit detection is going to come into Play also if you decide to expand on the data pack you can access the information for the mob hits if you need to try to get specific mob hits to do specific things you can go so far with it it is insane so with that said let’s jump back Into vs code all right we’re back in vs code so let’s start setting up this hit detection stuff so where we’re going to start is we need to make sure that weapons unor Chach our our main namespace folder is underlined here we’re going to make a new folder and we Are going to call this one advancements beautiful so inside of advancements we are going to create a new file and then this one is going to be called dealore damage. Json like so now you’re going to have these errors pop up and stuff don’t worry it is fine we will fix this here In a second so this I’m going to type out real quick for you guys what we’re going to do is do some curly brackets like so and uh hit enter now we are going to do the quotations we are going to autofill with criteria there it should populate all of this stuff we’re Going to hit enter again we’re going to do quotations and we’re going to hit uh requirement I guess it’s not going to populate so we’re going to have to type this one out requirement like so and then we’re going to space over there real quick and hit the colon and it’s Going to populate the brackets for us beautiful now we are going to type out trigger we’re going to tab that over and we are going to put inside here Minecraft and then uh colon player hurt entity right there so we’re going to space that down there and then hit um Tab and it will autocomplete for us so then now we need to jump down to the second brace curly brace right here and we are going to do a comma and then we are going to hit enter and then what we’re going to do here is quotations and We are going to drop down to rewards we’re going to tab that in and then we’re going to hit enter and then we are going to do the quotations and then we’re going to drop down to function tab that in we are going to drop down to weapons CH and then colon And then we are going to name this function dealore damage so now we can move forward here by saving all of this stuff and then we’re going to move into creating the deal damage uh MC function so with that said let’s jump down into functions here we are going to create a New file and then we’re simply just going to call this one dealore damage. MZ function woo hit enter on that now so inside of This MC function a lot is going to be going on we’re going to break it down as we go but what’s going to be awesome about this is it’s Going to be able to allow you to categorize all the different swords and weapons that you might be creating uh to to run checks and to run the specific functions associated with that weapon so it’s going to be pretty cool with that said we’re going to get started with This uh we’re going to type in tag and then we’re going to do at s so we’re going to drop down there hit Tab and then add and then attacker so we need to add this tag because our ourselves or us ourselves I don’t know how to explain That we’re the attacker so we need to be tagged as the attacker and then what we also need to do is remove the advancement so we’re going to revoke that um and then it’s going to be at s and then only and then we are going to type in Here weapons unor CH and then deal damage all right so with that finished now what we can do is start setting up for all the different custom swords so this is where all of that stuff that I was talking about is going to happen so In this case we are going to start with custom sword one cuz we only have one sword at this point this is where you would list of your different weapons that you have you know like here here here here here here etc etc right so What this is going to do is this is like an if predicate statement and uh this is the first time we’re kind of messing around with predicates in I think any data pack video I’ve done so far so it’s going to get pretty cool with what we Can do here so with that said let’s get this thing typed out we’re going to do execute and uh if and then predicate oh not biome what am I doing there predicate predicate predicate I don’t want it why isn’t it what okay okay I don’t know why I did that so if predicate and then uh what we’re going to do is weapons _ Chach and then we are going to point towards our uh item that we are holding so holding item which we have not created this yet but I’m going to call it holded or Holding uncore item like so and then we are going to do SL custom uhor sord one and you have to remember these things because we are going to be creating uh the files and folders Associated so there’s that and we will do as and then at e this is where things Are going to get really kind of complex so we are going to be creating a section of tags for entity types that are going to be the mob list so that’s where we’re able to basically dissect which mob you’re hitting etc etc that’s where you Can go super crazy if you want to we’re not going to do that in this tutorial series but it opens up the door with so many cool possibilities so we’re going to do type equals and then we’re going to do hashtag and then it’s going to be called weapons underscore shot we’re Going to do a colon and then mobs that’s that so then what we need to do is the comma and then distance um so it’s going to be dot dot and then 10 and then we’re going to do another comma and then this one’s going to be uh NBT this is going To be the hurt time so we can do this and we’ll do hurt time should be right there yep and then we’re going to just do it for 10 that’s that so we can go outside of these curly brackets do the comma and then we’re going to tag this Entity that we are attacking as not the Tacker so we need tag equals and then the exclamation point and attacker what that means is basically not the attacker so not us and then once we have that completed we we just uh go outside of the brackets there we’re going to do at We’re going to do at s and we are going to run the function that is not how you spell function function weapons chot and then it’s going to be a colon and then we’re going to point towards our swords folder because that’s where our sword is held our MC function So it’s going to be swords and then forward slash we need to go to the exact sword and as you can see it populated right there as sword one so we are going to tab that in and good to go before moving on I did forget to just type out Here we need to remove our attacker tag that we have up here at the top so let’s do tag and then it’s going to be at s and then remove and then attacker and then we are good to go here this is all done all right so now that The deal damage MC function is completed let’s jump into creating our predicates so with that said we just need to go into to weapons _ Chach in my case we’re going to add a new folder and we are going to call this one predicates and then inside of this one we’re going to Create another folder and we are going to call it holding now that spell there we go holding uncore item like so and then inside of here we’re going to create our predicates uh for our first sword so we’re going to add a new file and we are going to call this custom _ Sword one. Json beautiful all right so ins of here we are going to get this guy configured all right so inside of here we just need some curly braces you’re going to hit enter and then we are going to start typing out with quotations condition should autop populate like so So we’re going to tab that in and then what we need here is Minecraft and then uh colon and then entity properties like that then we are going to have a comma after this and then we are going to have uh entity in there and then we are going to point at This with another comma and then this is where predicates begin here we are going to select predicate and then enter yet again then inside of here we are going to do equipment then enter and then main hand like so and then we are going to hit enter yet again so this is basically Going to run a Check what we have in our main hand and we are going to search for the uh NBT tag and if you remember inside of our give. MC function we had our sword with a custom uh item data so it was custom Item uncore item uh one if we go back inside of here and uh scroll over you can see we have sword one as custom item 1 so basically what this is doing is checking the main hand and making sure that we are holding exactly uh this Sword here so with that explained we can start doing our tags for our entity types so what we need to do is come back here to weapons Chach in my case we’re going to add a new folder we’re going to call this one tags and then inside of Tags we are going to create another folder that’s going to be called entity entity uh uncore and then types and inside of here we are going to create a file that is going to be called mobs. Json so inside of here what I’m going to do is copy and paste the the List from a previous project that I have worked on so let’s get this in here and the reason why I’m doing this is because it is a massive list I’m not going to sit here and type it out for you guys like word from word but uh if you are Interested in obtaining a list like this there’s pretty much two ways you can do it that I know of you can just do a quick Google search for entity types Minecraft and I’m sure you’ll find some sort of list that’s already been pre-built that some somebody has out There if you’re interested in getting your hands on exactly what we’re doing here today I will have this available for download inside of my Discord under data pack download section chat uh you’ll be able to go inside of there and then you’ll see the video title along With the link and you’ll be able to download this pack in its entirety as you see here which will give you this list as well all right here I am back in Minecraft and I have an assortment of mobs in my inventory and we’re going to Run through and test them so we already know the spider should work so let’s hit that one that one good to go let’s do the oxal he likes to have some trouble sometimes and as we can see he is working with our hit detection beautiful The uh Blaze as well seems to be working we’re probably not going to kill him but uh he’s definitely floating with effects let’s do some bacon of course uh we killed him right off the rip hang on let’s try this again there we go he’s floating up as Well and then villagers also like to have problems with hit detection so let’s see if that works and it does beautiful so hopefully you guys did enjoy if so please hit the like button for the love bacon if you haven’t already hit that subscribe button with all those Bell notifications and stuff That YouTube makes us do now and with all that said be safe be kind know that you’re appreciated and I will catch you in the next one Video Information
This video, titled ‘How to Make A Custom Weapon Minecraft – Datapack Tutorial EP 1’, was uploaded by superchache39 on 2024-02-17 18:00:22. It has garnered 356 views and 18 likes. The duration of the video is 00:22:10 or 1330 seconds.
Let’s learn how to make a custom weapon in Minecraft. By the end of this episode you will have an excellent understanding of how to make a custom weapon in Minecraft with hit detection. This video is apart of my tutorial series on how to create custom weapons using Minecraft data packs! Today we begin creating our custom sword by adding unique abilities and effects to the weapon, along with setting up a hit detection system!
➜ MC Stacker: https://mcstacker.net/ ➜ Sub 4 Bacon: https://youtube.com/c/superchache39?sub_confirmation=1
📑 Timestamps: 00:00 – Intro 00:11 – VSCode, Setting Up, Sword Functions 09:51 – First Test 10:52 – VSCode & Hit Detection System 21:18 – Final Test 21:53 – Outro
📺 Previous Videos: ➜ Create Custom Structures: https://youtu.be/s3y4aWVZJeo ➜ Spawn Villages: https://youtu.be/RgynTXegZBY ➜ Add Rare Structures: https://youtu.be/EFK66GnX40M ➜ Add Structures to Specific Biomes: https://youtu.be/01aDlduWJCE ➜ Make Custom Loot Tables: https://youtu.be/F6ezeXSdVqM ➜ Spawn Mobs & Entities: https://youtu.be/0IzPIKCRL_c ➜ How to Spawn in Decorations: https://youtu.be/E8vK-s0xMRg ➜ Full Playlist: https://www.youtube.com/playlist?list=PLmCbaO6YoDEZDlWIJqs0bz7I5qC1adHDR
📢 Hit Me Up On: ➜ Discord: https://discord.gg/tpCUpN2 ➜ Twitch.TV: https://goo.gl/pg9axF ➜ Instagram: https://goo.gl/Zq11XQ ➜ Twitter: https://goo.gl/MSrEt8 ➜ TikTok: https://www.tiktok.com/@superchache39? ➜ PMC: https://www.planetminecraft.com/member/superchache39/
#MinecraftDatapack #MinecraftModding #CodeAlongTutorial #minecraftcrafting