Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Changing vanilla classes without editing them
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Evgenit

Changing vanilla classes without editing them

By Evgenit, October 31, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Evgenit    0

Evgenit

Evgenit    0

  • Tree Puncher
  • Evgenit
  • Members
  • 0
  • 7 posts
Posted October 31, 2013

Title

I need help, I want to change what iron and gold drops, but i dunno the event that is doing it so I can't hook it. The only way i managed to do it is editing the BlockOre vanilla class, but this may cause mod incompatibility. I also want to remove some vanilla recipes without editing vanilla classes or is it uneccesery?

 

NOTE: I started modding forge 2 days ago, without knowing the java or any other language.

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2402

Draco18s

Draco18s    2402

  • Reality Controller
  • Draco18s
  • Members
  • 2402
  • 15924 posts
Posted October 31, 2013

ASM or Reflections.

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

Share this post


Link to post
Share on other sites

Evgenit    0

Evgenit

Evgenit    0

  • Tree Puncher
  • Evgenit
  • Members
  • 0
  • 7 posts
Posted October 31, 2013

As I said i started proggraming 2 days ago. What is ASM/reflections?

  • Quote

Share this post


Link to post
Share on other sites

Musebo    0

Musebo

Musebo    0

  • Tree Puncher
  • Musebo
  • Members
  • 0
  • 3 posts
Posted October 31, 2013

I'll tell you what I did to change the loot from killing a sheep, I think it is similar to changing the drops of a iron ore block.

 

I removed the spawning of sheep in my main mod file.

I added my the spawning of a sheep(my mod sheep).

Then I created the class of 'my mod sheep' and extended the vanilla Minecraft Sheep class.

 

I used a @Override command to override the code that defined the drops when sheep gets killed.

  • Quote

Share this post


Link to post
Share on other sites

Akjosch    4

Akjosch

Akjosch    4

  • Tree Puncher
  • Akjosch
  • Members
  • 4
  • 17 posts
Posted October 31, 2013

DemoXin just published his "FortuneOres" mod which does exactly that and is open source, so you can check for yourself how he did that - or ask him:

 

http://www.minecraftforum.net/topic/2079807-fortuneores/

  • Quote

ItemBlock is not a Block

ItemStack is not an Item

Damage value is not metadata

 

Stop confusing them.

Share this post


Link to post
Share on other sites

Knux14    0

Knux14

Knux14    0

  • Stone Miner
  • Knux14
  • Members
  • 0
  • 51 posts
Posted October 31, 2013

By using a coremod: http://www.minecraftforum.net/topic/1854988-tutorial-162-changing-vanilla-without-editing-base-classes-coremods-and-events-very-advanced/

or

http://www.minecraftforge.net/wiki/Using_Access_Transformers

 

or By using reflexion: http://tutorials.jenkov.com/java-reflection/index.html

 

Coremod is the way to do because it's Forge based. But reflexion works too.

  • Quote

Share this post


Link to post
Share on other sites

Evgenit    0

Evgenit

Evgenit    0

  • Tree Puncher
  • Evgenit
  • Members
  • 0
  • 7 posts
Posted October 31, 2013

Omg, he was 1 day ahead, just about to make the same thing... Anyways thanks guys, good thing my mod has something more...

  • Quote

Share this post


Link to post
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.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • NovaViper
      1.16.5 Forge Crashing On Start

      By NovaViper · Posted 20 minutes ago

      I'm having the same issue as OP on 1.16.4, here's my log:debug.log My machine is running Manjaro 20.1 with OpenJRE 15
    • DaemonUmbra
      I don't know how forge works

      By DaemonUmbra · Posted 39 minutes ago

      You can This is accomplished by putting the mods in the server's mods folder.   You must install Forge to .minecraft (the default location) unless you are doing something funny with your launcher. This is NOT how you make separate instances of Forge.
    • DaemonUmbra
      Forge Installer Not Opening

      By DaemonUmbra · Posted 44 minutes ago

      If you have Java installed correct you should be able to just double click the installer and Java will handle running it.
    • DaemonUmbra
      1.12.2 Forge Server Not starting with command arguements

      By DaemonUmbra · Posted 45 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • DaemonUmbra
      Amazinwave

      By DaemonUmbra · Posted 45 minutes ago

      1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  • Topics

    • SirStavros
      2
      1.16.5 Forge Crashing On Start

      By SirStavros
      Started 5 hours ago

    • Mark74
      7
      I don't know how forge works

      By Mark74
      Started 4 hours ago

    • BlakeRowsGood
      1
      Forge Installer Not Opening

      By BlakeRowsGood
      Started 2 hours ago

    • MKR0902
      1
      1.12.2 Forge Server Not starting with command arguements

      By MKR0902
      Started 4 hours ago

    • Amazinwave
      1
      Amazinwave

      By Amazinwave
      Started 4 hours ago

  • Who's Online (See full list)

    • DaemonUmbra
    • Killer_7968
    • Lodran
    • AubriTheHuman
    • King Kaden
    • NovaViper
    • man2870
    • foonicular
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Changing vanilla classes without editing them
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community