Jump to content

Recommended Posts

Posted

I'm trying to make a really nice Minecraft 1.10 mod, and I'd like to give it some TNT, some that explode lava everywhere, and some that simply have bigger blast radii. How should I write the classes for the unprimed and primed versions of these? I already have basic coding knowledge and some textures.

 

Update: Thank you guys for making my modding easier! Sorry if some of my posts were rude before I fixed them; this was my first time on any forum.

Posted

Check out BlockTNT.java and go from there. For making the one that shoots lava everywhere, try having it spawn falling blocks with the block set to lava, and having those blocks spawn just before the explosion to have them actually go everywhere.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

Posted
  On 12/12/2016 at 4:07 PM, imacatlolol said:

Check out BlockTNT.java and go from there. For making the one that shoots lava everywhere, try having it spawn falling blocks with the block set to lava, and having those blocks spawn just before the explosion to have them actually go everywhere.

How do I do that? While I do have basic knowledge of Java, I'm still fairly new to modding and don't wanna mess anything up with the game's code. Also, I use Eclipse if this helps you find a good response.
Posted
  On 12/12/2016 at 5:10 PM, DanielD34 said:

and don't wanna mess anything up with the game's code

 

You can't. Literally.

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.

Posted
  On 12/12/2016 at 5:04 PM, TheSunCat said:

I think the book Minecraft Modding With Forge contains information about a custom TNT. I am not sure though. I know you need a TNT block class, a TileEntityTNT, a PrimedTNT entity, and something else I can't quite remember...

I don't feel like paying money for a book about modding, but thanks for the suggestion.
  Quote

Check out BlockTNT.java and go from there. For making the one that shoots lava everywhere, try having it spawn falling blocks with the block set to lava, and having those blocks spawn just before the explosion to have them actually go everywhere.

Thanks for the tip, but how do I get into that TNT class?

  Quote

  Quote

and don't wanna mess anything up with the game's code

 

You can't. Literally.

Thanks. I should've known.
Posted
  On 12/12/2016 at 5:36 PM, DanielD34 said:

Now, how do I get into that TNT class?

 

In Eclipse, under the Package Explorer, there should be a "folder" called Referenced Libraries (there might not be, in which case skip this).  Inside that will be a file called "forgeSrc-[mc version]-[forge version].jar"

 

You will be able to open up that jar file and brows the MC source code.  TNT will be down under:

- net.minecraft.blocks

- net.minecraft.entities

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.

Posted
  On 12/12/2016 at 5:41 PM, Draco18s said:

  Quote

Now, how do I get into that TNT class?

 

In Eclipse, under the Package Explorer, there should be a "folder" called Referenced Libraries (there might not be, in which case skip this).  Inside that will be a file called "forgeSrc-[mc version]-[forge version].jar"

 

You will be able to open up that jar file and brows the MC source code.  TNT will be down under:

- net.minecraft.blocks

- net.minecraft.entities

Thank you so much! That'll make modding SO much faster and easier!

  Quote

Check out BlockTNT.java and go from there. For making the one that shoots lava everywhere, try having it spawn falling blocks with the block set to lava, and having those blocks spawn just before the explosion to have them actually go everywhere.

I'll keep that in mind. You both have my thanks.
Posted
  Quote
Now, how do I get into that TNT class?

In a tool as versatile as Eclipse-J, there's more than one way to move around. In the future, if you can't remember where to look for something (or can't guess which package you need even after remembering the lib), then try throwing a spurious declaration into a method in any class you're editing. Write something like: BlockTNT tnt;

 

At that point, Eclipse will underline BlockTNT, and hovering will raise a complaint that it's unresolved. Right-clicking then should offer you the option of importing the class from Minecraft (NB: A handful of classes, like "Block", have very common names, so you may be offered imports from weird places that are almost always not what you want, and you won't have their source code anyway). Once you do that, then you can select it and hit F3 to open it in a new tab. Then delete your spurious declaration and type ctrl-shift-o to fix your imports.

 

Once you get into even one vanilla java file near what you want to use or imitate, then you can select things in it and use F3 to open more files. You may also ask eclipse to show any of those classes to you in the package explorer, which will expand whatever package you need wherever it is. In that package you may see other classes that could be instructive.

 

And then there's "show references", which can show you how something is used.

 

General take away lesson: An IDE is a powerful tool. Learn its features and use them.

 

PS: For vanilla source to show up, one must have setup a decomp workspace. The dev workspace doesn't include the vanilla source. It doesn't seem to be as much of a problem as it was a few years ago, but there may still be some necrotic "how-to" articles on the web telling noobs to setup the dev workspace.

 

 

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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

    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • I removed yetanotherchance booster and now it says Invalid player identity
    • Cracked Launchers are not supported
    • After some time minecraft crashes with an error. Here is the log https://drive.google.com/file/d/1o-2R6KZaC8sxjtLaw5qj0A-GkG_SuoB5/view?usp=sharing
    • The specific issue is that items in my inventory wont stack properly. For instance, if I punch a tree down to collect wood, the first block I collected goes to my hand. So when I punch the second block of wood to collect it, it drops, but instead of stacking with the piece of wood already in my hand, it goes to the second slot in my hotbar instead. Another example is that I'll get some dirt, and then when I'm placing it down later I'll accidentally place a block where I don't want it. When I harvest it again, it doesn't go back to the stack that it came from on my hotbar, where it should have gone, but rather into my inventory. That means that if my inventory is full, then the dirt wont be picked up even though there should be space available in the stack I'm holding. The forge version I'm using is 40.3.0, for java 1.18.2. I'll leave the mods I'm using here, and I'd appreciate it if anybody can point me in the right direction in regards to figuring out how to fix this. I forgot to mention that I think it only happens on my server but I'm not entirely sure. PLEASE HELP ME! LIST OF THE MODS. aaa_particles Adorn AdvancementPlaques AI-Improvements AkashicTome alexsdelight alexsmobs AmbientSounds amwplushies Animalistic another_furniture AppleSkin Aquaculture aquamirae architectury artifacts Atlas-Lib AutoLeveling AutoRegLib auudio balm betterfpsdist biggerstacks biomancy BiomesOPlenty blockui blueprint Bookshelf born_in_chaos Botania braincell BrassAmberBattleTowers brutalbosses camera CasinoCraft cfm (MrCrayfish’s Furniture Mod) chat_heads citadel cloth-config Clumps CMDCam CNB cobweb collective comforts convenientcurioscontainer cookingforblockheads coroutil CosmeticArmorReworked CozyHome CrabbersDelight crashexploitfixer crashutilities Create CreativeCore creeperoverhaul cristellib crittersandcompanions Croptopia CroptopiaAdditions CullLessLeaves curios curiouslanterns curiouslights Curses' Naturals CustomNPCs CyclopsCore dannys_expansion decocraft Decoration Mod DecorationDelightRefurbished Decorative Blocks Disenchanting DistantHorizons doubledoors DramaticDoors drippyloadingscreen durabilitytooltip dynamic-fps dynamiclights DynamicTrees DynamicTreesBOP DynamicTreesPlus Easy Dungeons EasyAnvils EasyMagic easy_npc eatinganimation ecologics effective_fg elevatorid embeddium emotecraft enchantlimiter EnchantmentDescriptions EnderMail engineersdecor entityculling entity_model_features entity_texture_features epicfight EvilCraft exlinefurniture expandability explosiveenhancement factory-blocks fairylights fancymenu FancyVideo FarmersDelight fast-ip-ping FastSuite ferritecore finsandtails FixMySpawnR Forge Middle Ages fossil FpsReducer2 furnish GamingDeco geckolib goblintraders goldenfood goodall H.e.b habitat harvest-with-ease hexerei hole_filler huge-structure-blocks HunterIllager iammusicplayer Iceberg illuminations immersive_paintings incubation infinitybuttons inventoryhud InventoryProfilesNext invocore ItemBorders itemzoom Jade jei (Just Enough Items) JetAndEliasArmors journeymap JRFTL justzoom kiwiboi Kobolds konkrete kotlinforforge lazydfu LegendaryTooltips libIPN lightspeed lmft lodestone LongNbtKiller LuckPerms Lucky77 MagmaMonsters malum ManyIdeasCore ManyIdeasDoors marbledsarsenal marg mcw-furniture mcw-lights mcw-paths mcw-stairs mcw-trapdoors mcw-windows meetyourfight melody memoryleakfix Mimic minecraft-comes-alive MineTraps minibosses MmmMmmMmmMmm MOAdecor (ART, BATH, COOKERY, GARDEN, HOLIDAYS, LIGHTS, SCIENCE) MobCatcher modonomicon mods_optimizer morehitboxes mowziesmobs MutantMonsters mysticalworld naturalist NaturesAura neapolitan NekosEnchantedBooks neoncraft2 nerb nifty NightConfigFixes nightlights nocube's_villagers_sell_animals NoSeeNoTick notenoughanimations obscure_api oculus oresabovediamonds otyacraftengine Paraglider Patchouli physics-mod Pillagers Gun PizzaCraft placeableitems Placebo player-animation-lib pneumaticcraft-repressurized polymorph PrettyPipes Prism projectbrazier Psychadelic-Chemistry PuzzlesLib realmrpg_imps_and_demons RecipesLibrary reeves-furniture RegionsUnexplored restrictedportals revive-me Scary_Mobs_And_Bosses selene shetiphiancore ShoulderSurfing smoothboot
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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