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

Changing vanilla classes without editing them


Evgenit
 Share

Recommended Posts

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.

Link to comment
Share on other sites

ASM or Reflections.

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

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.

Link to comment
Share on other sites

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

    • i have Java but not in this folder  
    • If it is so easy i woudent tell you.   Execution failed for task ':compileJava'. > Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_301 contains a valid JDK installation. Possible solution:  - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html   How can i cange the folder 
    • public static void getNBTDataFromItemFrameItem(ItemFrameEntity item, World world) throws IOException { if(item.getItem().sameItem(new ItemStack(Items.FILLED_MAP))){ fileCount++; File file = new File("anything", "data" + fileCount + ".dat"); try { MapData nbt = FilledMapItem.getOrCreateSavedData(item.getItem(), world); assert nbt != null; CompressedStreamTools.writeCompressed(nbt.serializeNBT(), file); System.out.println("done"); } catch (Exception e) { e.printStackTrace(); } } } Now I just get error that it cant serialize the data java.lang.NullPointerException [19:59:33] [Render thread/INFO] [STDERR/]: [me.hakak.entityfindmod.commands.findItemFrames:getNBTDataFromItemFrameItem:63]: at net.minecraft.world.storage.MapData.save(MapData.java:160) [19:59:33] [Render thread/INFO] [STDERR/]: [me.hakak.entityfindmod.commands.findItemFrames:getNBTDataFromItemFrameItem:63]: at net.minecraft.world.storage.WorldSavedData.serializeNBT(WorldSavedData.java:63) [19:59:33] [Render thread/INFO] [STDERR/]: [me.hakak.entityfindmod.commands.findItemFrames:getNBTDataFromItemFrameItem:63]: at me.hakak.entityfindmod.commands.findItemFrames.getNBTDataFromItemFrameItem(findItemFrames.java:60)  
    • It tells you exactly what the issue is. Just fix it...
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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