Posted July 21, 201312 yr 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 http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 21, 201312 yr Author Can you repeat that a bit more clearly please? http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 21, 201312 yr Author My example is very exact on what I want to do. http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 21, 201312 yr Author But where do I put the PlaySoundAtEntityEvent?? In the main class? Yes, I do. I read the help document of ASM and I didn't know what to do. I'm currently starting with Java, so some more hints of what to do would be cool http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 22, 201312 yr Author Any more help on that? http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 22, 201312 yr 1 look at the wiki for how to handle events http://www.minecraftforge.net/wiki/Event_Reference#Forge_Events 2 learn java not in this order... how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 22, 201312 yr Author I already watched until Java Tutorial 31 of TheNewBoston. And thanks for that link. http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 22, 201312 yr Author Ok, it works now. But how can I assign the cancelling only for the creeper?? http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 22, 201312 yr just check that the entity is a creeper and cancel the event is so ? how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 24, 201312 yr Author 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 http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 24, 201312 yr google how to use the instanceof keyword, itll you GREATLY how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 24, 201312 yr Author Thanks that worked! (As I said, just starting with Java http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
July 24, 201312 yr 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-
July 24, 201312 yr Author *presses Thank you button* http://i.imgur.com/kPfhwnJ.png[/img] ↑↑↑↑↑↑↑↑↑↑ Click it please? :3 ↑↑↑↑↑↑↑↑↑↑
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.