Jump to content

Indirectly editing entity classes / Removing methods


bl4ckscor3
 Share

Recommended Posts

Hello guys. I have a quick and simple question. How can I remove a method from an entity class without directly editing it? For example removing the sounds from a creeper.

 

Should I give a better explanation, or do you know what I mean? If you do, can you help me, and how would I do this?

 

~bl4ckscor3

↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑

Link to comment
Share on other sites

Can you repeat that a bit more clearly please?

I am not really sure what is unclear about that.

Here are some links for further information:

http://en.wikipedia.org/wiki/Java_bytecode

http://asm.ow2.org/

 

Also read the FML code, it should teach you how to make a coremod.

But maybe tell us what exactly you are trying to achieve, often a coremod is not needed.

Link to comment
Share on other sites

I know got this code:

package tests;

import net.minecraft.entity.Entity;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.PlaySoundAtEntityEvent;

public class PlayCreeperSounds 
{
@ForgeSubscribe
public void playCreeperSounds(PlaySoundAtEntityEvent event)
{
	Entity entity = event.entity;

	if(entity.entityId == 50)
	{
		if(event.isCancelable())
		{
			event.setCanceled(true);
		}
	}
}
}

But it doesn't work (according to SPC, the entityId of the creeper is 50

↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑

Link to comment
Share on other sites

dont forget to hit the thank you button

 

btw entity.entityID is a unique id for every entity, meaning maybe a creeper has entityid 50 but another could have 156

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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



×
×
  • Create New...

Important Information

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