Jump to content

[Solved] 1.10.2 Randomised Tool Material


PegBeard
 Share

Recommended Posts

You will have to write the data the tool material stores to nbt and read the data from nbt in the methods that call for them.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Should be able to. I did this in 1.7.10 and as long as you override the proper methods you can read the values from NBT and figure it out from there.

 

getMaxDamage

is how much durability the item has (based on material)

getDigSpeed

is how fast the material affects block breaking

getIsRepairable

handles repair in the anvil (e.g. if you want to allow iron ingots to repair iron items)

getAttributeModifiers

to modify item damage based on material

addInformation

and/or

getItemStackDisplayName

if you want to have a tooltip saying what the item's material is

 

Note: method signatures have likely changed since 1.7.10, but you can see how I handled this stuff in my Artifacts mod:

https://github.com/Draco18s/Artifacts/blob/master/main/java/com/draco18s/artifacts/item/ItemArtifact.java

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

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

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I keep getting this error and have no idea how to fix it. I have tired for about one day but managed to fix another issue which coincided with this one but no luck here.   My error log java.lang.NullPointerException: Parameter specified as non-null is null: method io.github.realyusufismail.armourandtoolsmod.core.blocks.armour.CustomArmourCraftingTableScreen.slotClicked, parameter pSlot at io.github.realyusufismail.armourandtoolsmod.core.blocks.armour.CustomArmourCraftingTableScreen.slotClicked(CustomArmourCraftingTableScreen.kt) ~[main/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.mouseReleased(AbstractContainerScreen.java:518) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.lambda$onPress$1(MouseHandler.java:101) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.Screen.wrapScreenError(Screen.java:530) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.onPress(MouseHandler.java:98) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.lambda$setup$4(MouseHandler.java:195) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:90) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.MouseHandler.lambda$setup$5(MouseHandler.java:194) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar:build 7] {} at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar:build 7] {} at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar:build 7] {} at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:164) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at com.mojang.blaze3d.platform.Window.updateDisplay(Window.java:301) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1190) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:718) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.run(Main.java:212) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:51) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {} at net.minecraftforge.fml.loading.targets.ForgeClientUserdevLaunchHandler.lambda$launchService$0(ForgeClientUserdevLaunchHandler.java:25) ~[fmlloader-1.19.3-44.1.0.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.8.jar:?] {} at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at io.github.realyusufismail.armourandtoolsmod.core.blocks.armour.CustomArmourCraftingTableScreen.slotClicked(CustomArmourCraftingTableScreen.kt) ~[%23189!/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.inventory.AbstractContainerScreen.mouseReleased(AbstractContainerScreen.java:518) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.lambda$onPress$1(MouseHandler.java:101) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.gui.screens.Screen.wrapScreenError(Screen.java:530) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.onPress(MouseHandler.java:98) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.MouseHandler.lambda$setup$4(MouseHandler.java:195) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:90) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.MouseHandler.lambda$setup$5(MouseHandler.java:194) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:43) ~[lwjgl-glfw-3.3.1.jar%23156!/:build 7] {} at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.3.1.jar%23168!/:build 7] {} at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3403) ~[lwjgl-glfw-3.3.1.jar%23156!/:build 7] {} at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:164) ~[forge-1.19.3-44.1.0_mapped_parchment_2022.12.18-1.19.3-recomp.jar%23184!/:?] {re:classloading,pl:runtimedistcleaner:A} -- Affected screen -- Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method io.github.realyusufismail.armourandtoolsmod.core.blocks.armour.CustomArmourCraftingTableScreen.slotClicked, parameter pSlot My code : https://github.com/RealYusufIsmail-Mc-Mods/Armour-and-Tools-Mod/blob/recipe/src/main/kotlin/io/github/realyusufismail/armourandtoolsmod/core/blocks/armour/CustomArmourCraftingTableScreen.kt
    • I used multiple biomes by setting the type to minecraft:multi_noise. The dimension is working fine now, but I was wondering if there is a way to supress this warning when creating a new world: Warning! These settings are using experimental features. These settings are experimental and could one day stop working. Do you wish to proceed?
    • Hi. Please help. Forge keep crashing on my pc (error code 1). This happened after i updated my PC to the latest windows 11 update. I have tried updating my GPU driver, reinstall java and reinstall minecraft, but i still got this error code 1. Any help is appreciated. Thanks.  
    • here are the logs https://gist.github.com/Myrious/13e16642c4afe9c0286691571bd136f0
    • I Start Up the game get a crash before forge even starts to load Crash Log-https://gist.github.com/keepinitreal247/c1024110beca289019a0177ddecfc910
  • Topics

×
×
  • Create New...

Important Information

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