Jump to content

Tinkers Construct like upgrading system


Phyyrus

Recommended Posts

Hey there, i was wondering if anybody could help me making a Tinkers like upgrading system, the mod is gonna add a whole bunch of armor and weapons, what i wanna do is that i have this certain material, i place the material into the swrod and its ginna be +1,  then +2 then +3, after that i want it to require a higher tier material in order to go up to+6and so on and forth until +10

Link to comment
Share on other sites

Small moves.

 

Implement features and test them out one by one. What you are describing is a fairly large-scale mod.

 

First, I suggest trying to just add +1 attack damage to a sword. Or just add a sword, first.

Link to comment
Share on other sites

Ok, but i dont wanna add like 30 materials for every sword, i wanna make it like, if the Weapon Class = dagger then do 4 hearts of damage, i dont wanna add 30 diffrent materials for each weapon class bcause also depending on what type of dagger it i, depends the durabiluty and the damage it does

Link to comment
Share on other sites

Ok, so to start, the first block, in order to create the weapons is gonna be something called a Titanite Blacksmith anvil, it has to be a tile entity, how will i code that, ive search all over the internet and i havent been able to understand them and also i would like to make it a 3-d Model, kinda like the Vanilla Anvil

Link to comment
Share on other sites

My advice would be to research how to create a custom furnace and go from there (changing the GUI, recipes, fuel, whatever you need to change). Once you learn how a furnace works, modifying it to make different machines isn't that difficult.

Link to comment
Share on other sites

You should be calling

registerBlock

somewhere else. In preinit or - I believe I heard this was better - the constructor of your block?

 

It is pretty basic Java knowledge not to write (most) code directly in your class, but write it in methods instead, which are then called.

 

I suggest you start writing a few programs like Hello World, a banking simulator, a number guessing game etc. :)

 

From there, you can move to modding.

 

Or you could just jump into it - expect harsh remarks when your issue is not with your code but your basic understanding of programming, though.

 

Either way, if you run into any Minecraft- or Forge-related issues, we are here to help. If you run into any programming issues in general, you could always throw me a PM and I will have a look at it :)

 

I almost have zero experience working with Minecraft and even less with Forge, but I do consider myself a fairly experienced programmer.

Link to comment
Share on other sites

You are lack of knowlage even in the basics.

I don't know you are actually learnt java or not but you must watch some basic tutorials!

If you not understand the TileEntity tutorial you are probably has to learn java first.

 

Don't do what i did because i never learnt java, but i can still make mods.

After 2 years of modding i understands Minecraft, Forge and Java!

If you learn java first and than modding you probably save 1,5 year!

Link to comment
Share on other sites

Hey, im making the Tile entity, and im getting this texture error in-game

http://prntscr.com/403vsn

 

This is my GitHub, please someone tell me what i did wrong

https://github.com/Phyyrus/Dark-Souls/blob/master/src/main/java/com/phyyrus/ds/TileEntity/TitaniteAnvil.java

^

Thats where my block is beaing coded at

 

And this is the tutorial im following

 

Edit:

The furnace texture is gonna be temporary, i wanna make the tile entity a custom Rendered block

Link to comment
Share on other sites

I will, like to people before me, strongly recommend that you learn java before you start making a mod! If you want to be impatient, then you could hop right in but, again, it will take longer in the long run. Once you have a basic understand of the concepts of OOP, then start by looking at other mods and try to make something (ie a custom furnace like above) that behaves in a different way. Then once you have this firmly grasped move on to the next thing. I can speak in your point of view because I too am just starting out and this is what seems to be working for me!  :)

I am currently learning java, but afterwards have some ideas for a mod that may or may not include some bitcoin aspects!

Link to comment
Share on other sites

I watched it.

 

Do you want a list?

This gave me a good laugh :D I haven't watched the video in question, but I've seen others that were absolute garbage. Sadly, knowledge of Java is not required to make a video tutorial.

 

@OP As many have mentioned, having at least a decent grasp of basic Java (or any other programming language) will help you immensely in your efforts at creating a mod. A site that I find myself going back to again and again is Oracle's own Java site, which not only has all of the Java docs, but also an excellent tutorial series on all the fundamentals that you will need.

 

As for your code, first of all I recommend adding @Override above all your class methods, just to make sure you didn't make any typos in the names and such. Note that this only goes for inherited methods (i.e. ones that are from the vanilla 'Block' class).

 

It looks like your png files are named correctly, so one thing that could be wrong is that Eclipse has not yet recognized the files as existing - this can happen if you copy/paste the files into your folder using Windows Explorer instead of pasting them in using Eclipse. Just to double-check, right-click your assets folder in the Eclipse package explorer and click 'Refresh' to re-scan the directory. This has happened to me lots of times.

Link to comment
Share on other sites

Yes Sure Elyon

 

"I watched it.

 

Do you want a list?"

  • The ModID used is not all lowercase
  • Vanilla code is obviously just being written into
    setDefaultDirection

    (have a look at BlockFurnace.java), with no thought or critical thinking. While being inspired by vanilla code is acceptable, you must keep in mind that vanilla code is not always perfect and can often times be written more concise or performant

  • byte b0

    in

    setDefaultDirection

    is the metadata, but the person talking in the video seems oblivious to this and just copies the code from BlockFurnace.java verbatim, save for variable names

  • The person talking in the video seems to have little to no idea the reason for what they are actually doing most of the time, and as such doesn't explain it, either
  • Vanilla code is also being copied into
    onBlockPlacedBy

    . This code in particular also suffers from terrible redundancies, but the person talking in the video probably has no idea about this, either

  • If you're going to outright copy so much from the vanilla furnace anyway, you might as well
    extend BlockFurnace

    and just override the methods that differ

This list is not exhaustive. I had a look at the next video in the series, and the quality of the code as well as the educational content does not improve.

Link to comment
Share on other sites

^^^ Great stuff, there xD Pretty amazing for someone 'not too familiar' with Minecraft modding and Forge!

 

@OP - don't take it personally that the tutorial you happened to watch has things wrong with it; it is certainly no reflection upon your character, but rather should spur you on to become more proficient in Java so you can select which tutorials to watch with a more discerning eye.

 

At any rate, you have two methods that can affect the facing of your block: onBlockAdded, which you have call setDefaultDirection and I'm pretty sure is called every time a block is added to the world, and onBlockPlacedBy, in which you also set a direction, but which is only called when the player places a block.

 

Now I can't remember in which order these are called, i.e. placed by player first or block added first, but that is where you should start your debugging. The fact that you still have a missing texture is concerning as well.

Link to comment
Share on other sites

What should i do then? To fix all of this,

And BTW, this is the GUI im gonna use for my anvil

and it wont exactly consume the hammer, what u want to to do is to take durability/time depending on what weapon your making

The more complex the weapon the longer it will take and the more durability it will take

 

5c7d7383f0.png

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Update: It seems like the forge version I was using was broken entirely, somehow... I am now using the Forge MDL 1.18.2-40.2.21 (previous used 40.2.18) version and now everything is working sort-of fine.... adding extra dependencies seems to break it again. It is so weird... Did anyone have similar issues with this before? I'm also using the Minecraft Development plugin for IntelliJ IDEA
    • Hello! I'm currently having issues while building a jar file for my Minecraft 1.18.2 Forge mod. I've attached a link to imgur below that holds two screenshots of the errors. I'm using Jetbrains IntelliJ IDEA 2024.1 and Gradle 8.4. This is my repo: Mod Repo When I was modding, I needed to build the mod in order to test the mod, which didn't work, as the first screenshot gives. It throws errors for each classes in the forge registry class (or whatever the hell that mess is) and is just generally confusing. Now I have deleted everything in my project folder and re-pulled the repo from github, which now gives the errors in the second image where all forge classes are not imported somehow. When I try to build it now, it just repeats the same errors in the first image. https://imgur.com/a/DYwSKqJ Please I need help desparately
    • [main/WARN] [net.minecraft.server.Main/]: Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode 8400java.util.concurrent.ExecutionException: com.google.gson.JsonParseException: Error loading registry data: No key name in MapLike[{"elements":[{"element":{"element_type":"minecraft:legacy_single_pool_element","location":"duneons:towns/village_creeperforest/town_center_01","processors":{"processors":[]},"projection":"rigid"},"weight":1}],"fallback":"minecraft:empty","forge:registry_name":"duneons:towns/village_creeperforest/town_centers"}] 8401at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?] 8402at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?] 8403at net.minecraft.server.Main.main(Main.java:182) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8404at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] 8405at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] 8406at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] 8407at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] 8408at net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:29) ~[fmlloader-1.19.2-43.3.13.jar%2367!/:?] 8409at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2354!/:?] 8410at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2354!/:?] 8411at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2354!/:?] 8412at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2354!/:?] 8413at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2354!/:?] 8414at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2354!/:?] 8415at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2354!/:?] 8416at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] 8417Caused by: com.google.gson.JsonParseException: Error loading registry data: No key name in MapLike[{"elements":[{"element":{"element_type":"minecraft:legacy_single_pool_element","location":"duneons:towns/village_creeperforest/town_center_01","processors":{"processors":[]},"projection":"rigid"},"weight":1}],"fallback":"minecraft:empty","forge:registry_name":"duneons:towns/village_creeperforest/town_centers"}] 8418at net.minecraft.core.RegistryAccess.m_206152_(RegistryAccess.java:211) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8419at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] 8420at net.minecraft.core.RegistryAccess.m_206159_(RegistryAccess.java:210) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8421at net.minecraft.core.RegistryAccess.m_206171_(RegistryAccess.java:203) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8422at net.minecraft.resources.RegistryOps.m_206817_(RegistryOps.java:32) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8423at net.minecraft.resources.RegistryOps.m_206813_(RegistryOps.java:25) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8424at net.minecraft.server.Main.lambda$main$2(Main.java:160) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8425at net.minecraft.server.WorldLoader.m_214362_(WorldLoader.java:24) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8426at net.minecraft.server.WorldStem.m_214415_(WorldStem.java:18) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8427at net.minecraft.server.Main.lambda$main$3(Main.java:158) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8428at net.minecraft.Util.m_214652_(Util.java:775) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8429at net.minecraft.Util.m_214679_(Util.java:770) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8430at net.minecraft.server.Main.main(Main.java:157) ~[server-1.19.2-20220805.130853-srg.jar%23243!/:?] 8431... 13 more 8432  
    • Try using 1.20.6-50.0.5, it just fixed an issue related to enchanting: https://github.com/MinecraftForge/MinecraftForge/commit/0e829630da67c91d2b5a91ea4b65eb033f868e76
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.