Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.16.4] help with container items


Glados1235
 Share

Recommended Posts

hello! I am new to Minecraft modding and I'm modding for 1.16.4 I want to create an item that doesn't get used and takes damage during crafting (like ic2's hammer or cutters)

this is the first mod I'm trying to make to learn and I prefer to learn through examples

here is what I have for the item in question LEGO_MOLD or lego_mold

 

my Item Init class

https://pastebin.com/X6pjkUEi

 

the container item class I think is correct? (followed a tutorial kiiinda know how it works but not really)

https://pastebin.com/Jpwerbgy

 

and the recipe I want to affect

https://pastebin.com/dYPCxdjf

 

I know the container class is what's needed but how do I make the LEGO_MOLD the item it's affecting?

like I said I'm brand new to this and don't know much java so examples would be super helpful!

and it this is in the wrong place please tell me i dont post on forms much thanks!

Edited by Glados1235
forgot the version in the title
Link to comment
Share on other sites

  • Glados1235 changed the title to [1.16.4] help with container items
6 minutes ago, diesieben07 said:

The lego_mold class is never used in the code you posted.

i know its not thats why im asking how do i do that like i said i know its the thing i need to use but how to i apply that lego_mold class to a item like the lego mold item

Link to comment
Share on other sites

41 minutes ago, diesieben07 said:

Do you know basic Java?

sort of i mostly know basic c# or unity code i came here to ask for help as i found barely anything on the topic of the post and i learn through examples as alot of stuff just wont make sense to my brain 

Link to comment
Share on other sites

11 hours ago, diesieben07 said:

Then you should know how to make an instance of a class and how inheritance works...

I don't that is why I'm asking for help here as there are no tutorials or examples anywhere that help with what I'm trying to do I've been trying for a few days now to figure it out and I cant I don't know what I'm supposed to do as no one wants to help

Link to comment
Share on other sites

Line 20 is wrong.

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

2 hours ago, Draco18s said:

Line 20 is wrong.

i had a feeling but i don't know how to properly fix it i know there is the .containerItem() function that i can add to the item but no matter what way i try i does not work

Edited by Glados1235
spelling
Link to comment
Share on other sites

Look at line 20 very carefully.
Think about what D7 said in his first reply.

Edited by Draco18s

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

okay so i sorta got it

i added 

public static final LegoMold legoMold = new LegoMold();

and changed line 20 to

	public static final RegistryObject<Item> LEGO_MOLD = ITEMS.register("lego_mold",
			() -> new Item(new Item.Properties().group(LegoModItemGroup.LEGO_MOD).maxStackSize(1).containerItem(legoMold)));

and now it works but instead of giving me back the mold but damaged it just gives me a air block so i assume i need to tell it what item to give?

Link to comment
Share on other sites

4 hours ago, Glados1235 said:

it just gives me a air block so i assume i need to tell it what item to give?

thats because ItemStack#shrink reduce the count of the Item
and 1 - 1 = 0, and if the item has a number of 0 it is removed (replaced by air)

Link to comment
Share on other sites

8 hours ago, Glados1235 said:

okay so i sorta got it

i added 

public static final LegoMold legoMold = new LegoMold();

and changed line 20 to

	public static final RegistryObject<Item> LEGO_MOLD = ITEMS.register("lego_mold",
			() -> new Item(new Item.Properties().group(LegoModItemGroup.LEGO_MOD).maxStackSize(1).containerItem(legoMold)));

and now it works but instead of giving me back the mold but damaged it just gives me a air block so i assume i need to tell it what item to give?

I don't know why you did this. Your item class was already perfectly fine. You just need to actually use it.

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.

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

    • today I was playing normal until my game crashed and returned to normal, after a while it crashed again and since then I can't play anymore I log in and the game closes with this error The game crashed whilst exception in server tick loop Error: java.util.ConcurrentModificationException Exit Code: -1 o crash completo : ---- Minecraft Crash Report ---- WARNING: coremods are present:   llibrary (llibrary-core-1.0.11-1.12.2.jar)   Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)   EnderCorePlugin (EnderCore-1.12.2-0.5.76-core.jar)   AppleCore (AppleCore-mc1.12.2-3.2.0.jar)   CTMCorePlugin (CTM-MC1.12.2-1.0.1.30.jar)   ForgelinPlugin (Forgelin-1.8.4.jar)   MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar) Contact their authors BEFORE contacting forge // Don't do that. Time: 10/17/21 2:26 AM Description: Exception in server tick loop java.util.ConcurrentModificationException     at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)     at java.util.HashMap$KeyIterator.next(HashMap.java:1453)     at net.minecraft.entity.EntityTracker.func_72788_a(EntityTracker.java:290)     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:779)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Thread.java:745) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 1647489200 bytes (1571 MB) / 4127195136 bytes (3936 MB) up to 5726797824 bytes (5461 MB)     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx6144m -Xms256m -XX:PermSize=256m     IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 104     FML: MCP 9.42 Powered by Forge 14.23.5.2847 72 mods loaded, 72 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State  | ID                                | Version                  | Source                                          | Signature                                |     |:------ |:--------------------------------- |:------------------------ |:----------------------------------------------- |:---------------------------------------- |     | LCHIJA | minecraft                         | 1.12.2                   | minecraft.jar                                   | None                                     |     | LCHIJA | mcp                               | 9.42                     | minecraft.jar                                   | None                                     |     | LCHIJA | FML                               | 8.0.99.99                | forge-1.12.2-14.23.5.2847.jar                   | None                                     |     | LCHIJA | forge                             | 14.23.5.2847             | forge-1.12.2-14.23.5.2847.jar                   | None                                     |     | LCHIJA | openmodscore                      | 0.12.2                   | minecraft.jar                                   | None                                     |     | LCHIJA | securitycraft                     | v1.8.16                  | [1.12.2] SecurityCraft v1.8.16.jar              | None                                     |     | LCHIJA | applecore                         | 3.2.0                    | AppleCore-mc1.12.2-3.2.0.jar                    | None                                     |     | LCHIJA | ctm                               | MC1.12.2-1.0.1.30        | CTM-MC1.12.2-1.0.1.30.jar                       | None                                     |     | LCHIJA | appliedenergistics2               | rv6-stable-7             | appliedenergistics2-rv6-stable-7.jar            | dfa4d3ac143316c6f32aa1a1beda1e34d42132e5 |     | LCHIJA | biomesoplenty                     | 7.0.1.2441               | BiomesOPlenty-1.12.2-7.0.1.2441-universal.jar   | None                                     |     | LCHIJA | jei                               | 4.15.0.291               | jei_1.12.2-4.15.0.291.jar                       | None                                     |     | LCHIJA | chisel                            | MC1.12.2-1.0.1.44        | Chisel-MC1.12.2-1.0.1.44.jar                    | None                                     |     | LCHIJA | chiselsandbits                    | 14.33                    | chiselsandbits-14.33.jar                        | None                                     |     | LCHIJA | codechickenlib                    | 3.2.3.358                | CodeChickenLib-1.12.2-3.2.3.358-universal.jar   | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | redstoneflux                      | 2.1.0                    | RedstoneFlux-1.12-2.1.0.6-universal.jar         | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LCHIJA | cofhcore                          | 4.6.3                    | CoFHCore-1.12.2-4.6.3.27-universal.jar          | None                                     |     | LCHIJA | cofhworld                         | 1.3.1                    | CoFHWorld-1.12.2-1.3.1.7-universal.jar          | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LCHIJA | crafttweaker                      | 4.1.20                   | CraftTweaker2-1.12-4.1.20.jar                   | None                                     |     | LCHIJA | ctgui                             | 1.0.0                    | CraftTweaker2-1.12-4.1.20.jar                   | None                                     |     | LCHIJA | crafttweakerjei                   | 2.0.3                    | CraftTweaker2-1.12-4.1.20.jar                   | None                                     |     | LCHIJA | cucumber                          | 1.1.3                    | Cucumber-1.12.2-1.1.3.jar                       | None                                     |     | LCHIJA | endercore                         | 1.12.2-0.5.76            | EnderCore-1.12.2-0.5.76.jar                     | None                                     |     | LCHIJA | thermalfoundation                 | 2.6.3                    | ThermalFoundation-1.12.2-2.6.3.27-universal.jar | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LCHIJA | thermalexpansion                  | 5.5.4                    | ThermalExpansion-1.12.2-5.5.4.43-universal.jar  | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LCHIJA | enderio                           | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiointegrationtic             | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiobase                       | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderioconduits                   | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderioconduitsappliedenergistics | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderioconduitsopencomputers      | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderioconduitsrefinedstorage     | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiointegrationforestry        | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiointegrationticlate         | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderioinvpanel                   | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiomachines                   | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | enderiopowertools                 | 5.3.70                   | EnderIO-1.12.2-5.3.70.jar                       | None                                     |     | LCHIJA | extrautils2                       | 1.0                      | extrautils2-1.12-1.9.9.jar                      | None                                     |     | LCHIJA | zerocore                          | 1.12.2-0.1.2.8           | zerocore-1.12.2-0.1.2.8.jar                     | None                                     |     | LCHIJA | bigreactors                       | 1.12.2-0.4.5.67          | ExtremeReactors-1.12.2-0.4.5.67.jar             | None                                     |     | LCHIJA | fastleafdecay                     | v14                      | FastLeafDecay-v14.jar                           | None                                     |     | LCHIJA | forgelin                          | 1.8.4                    | Forgelin-1.8.4.jar                              | None                                     |     | LCHIJA | llibrary                          | 1.7.20                   | llibrary-1.7.20-1.12.2.jar                      | b9f30a813bee3b9dd5652c460310cfcd54f6b7ec |     | LCHIJA | fossil                            | 8.0.5                    | fossilsarcheology-8.0.5.jar                     | None                                     |     | LCHIJA | waila                             | 1.8.26                   | Hwyla-1.8.26-B41_1.12.2.jar                     | None                                     |     | LCHIJA | mekanism                          | 1.12.2-9.8.3.390         | Mekanism-1.12.2-9.8.3.390.jar                   | None                                     |     | LCHIJA | teslacorelib                      | 1.0.16                   | tesla-core-lib-1.12.2-1.0.16.jar                | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | industrialforegoing               | 1.12.2-1.12.2            | industrialforegoing-1.12.2-1.12.13-237.jar      | None                                     |     | LCHIJA | inventorytweaks                   | 1.63+release.109.220f184 | InventoryTweaks-1.63.jar                        | 55d2cd4f5f0961410bf7b91ef6c6bf00a766dcbe |     | LCHIJA | ironchest                         | 1.12.2-7.0.67.844        | ironchest-1.12.2-7.0.72.847.jar                 | None                                     |     | LCHIJA | journeymap                        | 1.12.2-5.5.9             | journeymap-1.12.2-5.5.9.jar                     | None                                     |     | LCHIJA | malisiscore                       | 1.12.2-6.5.1-SNAPSHOT    | malisiscore-1.12.2-6.5.1.jar                    | None                                     |     | LCHIJA | malisisdoors                      | 1.12.2-7.3.0             | malisisdoors-1.12.2-7.3.0 (1).jar               | None                                     |     | LCHIJA | mantle                            | 1.12-1.3.3.55            | Mantle-1.12-1.3.3.55.jar                        | None                                     |     | LCHIJA | mekanismgenerators                | 1.12.2-9.8.3.390         | MekanismGenerators-1.12.2-9.8.3.390.jar         | None                                     |     | LCHIJA | numina                            | 1.12.2-1.0.38            | Numina-1.12.2-1.0.38.jar                        | None                                     |     | LCHIJA | powersuits                        | 1.12.2-1.0.46            | ModularPowersuits-1.12.2-1.0.46.jar             | None                                     |     | LCHIJA | mousetweaks                       | 2.10                     | MouseTweaks-2.10-mc1.12.2.jar                   | None                                     |     | LCHIJA | mysticalagriculture               | 1.7.5                    | MysticalAgriculture-1.12.2-1.7.5.jar            | None                                     |     | LCHIJA | omlib                             | 3.1.4-249                | omlib-1.12.2-3.1.4-249.jar                      | None                                     |     | LCHIJA | ompd                              | 3.1.0-61                 | ompd-1.12.2-3.1.0-61.jar                        | None                                     |     | LCHIJA | openmods                          | 0.12.2                   | OpenModsLib-1.12.2-0.12.2.jar                   | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | openblocks                        | 1.8.1                    | OpenBlocks-1.12.2-1.8.1.jar                     | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | openmodularturrets                | 3.1.6-362                | openmodularturrets-1.12.2-3.1.6-362.jar         | None                                     |     | LCHIJA | oreexcavation                     | 1.4.143                  | OreExcavation-1.4.143.jar                       | None                                     |     | LCHIJA | harvestcraft                      | 1.12.2zb                 | Pam's HarvestCraft 1.12.2zf.jar                 | None                                     |     | LCHIJA | placebo                           | 1.6.0                    | Placebo-1.12.2-1.6.0.jar                        | None                                     |     | LCHIJA | reborncore                        | 3.18.0                   | RebornCore-1.12.2-3.18.1.514-universal.jar      | 8727a3141c8ec7f173b87aa78b9b9807867c4e6b |     | LCHIJA | thermaldynamics                   | 2.5.5                    | ThermalDynamics-1.12.2-2.5.5.21-universal.jar   | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LCHIJA | toastcontrol                      | 1.8.1                    | Toast Control-1.12.2-1.8.1.jar                  | None                                     |     | LCHIJA | wawla                             | 2.6.274                  | Wawla-1.12.2-2.6.274.jar                        | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | jurassicraft                      | 2.1.23                   | JurassiCraft-1.12.2-2.1.23.jar                  | None                                     |     | LCHIJA | teslacorelib_registries           | 1.0.16                   | tesla-core-lib-1.12.2-1.0.16.jar                | None                                     |     Loaded coremods (and transformers):  llibrary (llibrary-core-1.0.11-1.12.2.jar)   net.ilexiconn.llibrary.server.core.plugin.LLibraryTransformer   net.ilexiconn.llibrary.server.core.patcher.LLibraryRuntimePatcher Inventory Tweaks Coremod (InventoryTweaks-1.63.jar)   invtweaks.forge.asm.ContainerTransformer EnderCorePlugin (EnderCore-1.12.2-0.5.76-core.jar)   com.enderio.core.common.transform.EnderCoreTransformer   com.enderio.core.common.transform.SimpleMixinPatcher AppleCore (AppleCore-mc1.12.2-3.2.0.jar)   squeek.applecore.asm.TransformerModuleHandler CTMCorePlugin (CTM-MC1.12.2-1.0.1.30.jar)   team.chisel.ctm.client.asm.CTMTransformer ForgelinPlugin (Forgelin-1.8.4.jar)    MekanismCoremod (Mekanism-1.12.2-9.8.3.390.jar)   mekanism.coremod.KeybindingMigrationHelper OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   openmods.core.OpenModsClassTransformer MalisisCorePlugin (malisiscore-1.12.2-6.5.1.jar)        GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.     OpenModsLib class transformers: [llama_null_fix:FINISHED],[horse_base_null_fix:FINISHED],[pre_world_render_hook:FINISHED],[player_render_hook:FINISHED],[horse_null_fix:FINISHED]     AE2 Version: stable rv6-stable-7 for Forge 14.23.5.2768     Ender IO: No known problems detected.     Authlib is : /C:/Users/User/Twitch/Minecraft/Install/libraries/com/mojang/authlib/1.5.25/authlib-1.5.25.jar     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     !!!You are looking at the diagnostics information, not at the crash.       !!!     !!!Scroll up until you see the line with '---- Minecraft Crash Report ----'!!!     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!     RebornCore:          Plugin Engine: 0         RebornCore Version: 3.18.0         Runtime Debofucsation 1         RenderEngine: 0     AE2 Integration: IC2:OFF, RC:OFF, MFR:OFF, Waila:ON, InvTweaks:ON, JEI:ON, Mekanism:ON, OpenComputers:OFF, THE_ONE_PROBE:OFF, TESLA:OFF, CRAFTTWEAKER:ON     Profiler Position: N/A (disabled)     Player Count: 1 / 8; [EntityPlayerMP['AventureiroMax'/313, l='jurassic craft', x=231.44, y=90.00, z=117.46]]     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'fml,forge'    
    • I realized the error but I'm not sure how I'm supposed to solve it. Some vanilla feature in the biome I'm using in my dimensions uses an absolute upper bound but relative lower bound. So when I made the min built height of my dimension greater, the lower bound increased so much that it became higher than the upper bound. I'm not sure how to fix this other than change my dimension min height, but I was trying to center my dimension at about surface level so that the correct features were carved. 
    • The Forge team can't support every version of Minecraft in-perpetuity. No software company does that with their software. Forge has decided that they will support the most recent major version (1.17) and a single LTS version (1.15) 1.12 is 4 years old at this point.
    • I need help, I can't enter my server, from one day to another I couldn't connect anymore, that LOG is what I get when I log in, I already tried with another launcher and with another account but it marks the same error, my friends They can still play on the server, and I being the owner of the server I can't enter haha please help   [02:34:32] [Netty Epoll Server IO #2/ERROR] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channels [carryon:carryonpackets] rejected their client side version number[02:34:32] [Netty Epoll Server IO #2/ERROR] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Terminating connection with client, mismatched mod list[02:34:32] [Server thread/INFO] [minecraft/ServerLoginNetHandler]: com.mojang.authlib.GameProfile@******[id=<null>,name=LeonardoRR,properties={},legacy=false] lost connection: Connection closed - mismatched mod channel list
    • I'm looking into UniformHeight because that seems to be the place where the message is logged. I'm not sure how the min > max thought because just finding usages of UniformHeight.of() shows that all the heights created seem to be constant. I'm not sure what's going on. 
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.