ihavenoidea Posted September 13, 2020 Share Posted September 13, 2020 (edited) The answer is probably super obvious but how do I make a custom sword for Minecraft 1.15.2? I have most the code written out but I need help with one part of it. Here's my code: public static final RegistryObject<Item> KNIFE = ITEMS.register("knife", () -> new SwordItem(ItemTier.IRON, 4, 1.3F, )); It tells me I need to put an Item.Properties builder but I don't know how to do that, and yes I did try and learn some Java (it was a Codecademy course). So what am I meant to put after 1.3F (which is the sword attack speed)? Edited September 13, 2020 by ihavenoidea Quote Link to comment Share on other sites More sharing options...
ihavenoidea Posted September 13, 2020 Author Share Posted September 13, 2020 Nope not yet, I'll look into them though. Quote Link to comment Share on other sites More sharing options...
Draco18s Posted September 13, 2020 Share Posted September 13, 2020 Pro tip: if someone else already did it, go look at their code. All of vanilla is there for you to examine. There are only a couple of systems that Forge provides that aren't vanilla (such as capabilities) but for the most part the advice holds true. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
ihavenoidea Posted September 13, 2020 Author Share Posted September 13, 2020 (edited) Quote Have you tried looking at vanilla items? Since that didn't help, I decided to put Item.Properties() and the Item properties and my IDE doesn't give me any errors so I'll see if it works when I run Minecraft. Edited September 13, 2020 by ihavenoidea Quote Link to comment Share on other sites More sharing options...
ihavenoidea Posted September 13, 2020 Author Share Posted September 13, 2020 2 minutes ago, Draco18s said: Pro tip: if someone else already did it, go look at their code. All of vanilla is there for you to examine. There are only a couple of systems that Forge provides that aren't vanilla (such as capabilities) but for the most part the advice holds true. Thanks for the tip, I also just tried looking at vanilla code and looking at Patty's More Stuff mod, but they used some custom features that they made themselves. Quote Link to comment Share on other sites More sharing options...
Beethoven92 Posted September 13, 2020 Share Posted September 13, 2020 It was enough to look at the vanilla "Items" class, there you can find all the vanilla items and see how they are initialized. Quote Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port Link to comment Share on other sites More sharing options...
ihavenoidea Posted September 13, 2020 Author Share Posted September 13, 2020 2 minutes ago, Beethoven92 said: It was enough to look at the vanilla "Items" class, there you can find all the vanilla items and see how they are initialized. Oh ok, I missed that class so many times and now I see how you are meant to initialize swords, thanks for telling me that. Quote Link to comment Share on other sites More sharing options...
Draco18s Posted September 13, 2020 Share Posted September 13, 2020 (edited) Right click on (almost) anything -> References -> Find in Project So if you did that on the SwordItem class, you'd find everywhere that the class itself was referenced....such as the Items class. Edited September 13, 2020 by Draco18s Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given. Link to comment Share on other sites More sharing options...
ihavenoidea Posted September 13, 2020 Author Share Posted September 13, 2020 2 minutes ago, Draco18s said: Right click on (almost) anything -> References -> Find in Project So if you did that on the SwordItem class, you'd find everywhere that the class itself was referenced....such as the Items class. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.