Posted March 23, 20178 yr Hello everybody! I'm currently learning how to write minecraft mods and I'm trying to make a techy mod without machines. And i'm trying to implement crushing as an anvil falling on a block. This is my code right now: http://pastebin.com/BKYgx2Su But it doesn't work. It would be really nice if somebody could help me with this problem. thanks in advance^^
March 23, 20178 yr Author 6 minutes ago, Pingubro said: Are you registering the Event? I can not see @SubscribeEvent in your posted code Oh yeah forgot that. Then I have to add a line in my mod class too right? Sorry I've started modding only yesterday
March 23, 20178 yr Ohh, did not check on that Event. And yes you need to register your EventClass in that case Crushing in your ModClass.
March 23, 20178 yr Author 4 minutes ago, diesieben07 said: On top of what @Pingubro already said, LivingDeathEvent will not fire for anvil entities, mainly because an anvil is not alive. Yeah aenterprise just wrote me on twitter I have to hook into the world to check when entitys get removed. But he doesn't know how since he hasn't modded since 1.6.4 could you please help me on this?
March 23, 20178 yr Try this Event: GetCollisionBoxesEvent ,as mentioned on Twitter it is a WorldEvent. Edit: Next time wait a bit more before writing. Edited March 23, 20178 yr by Pingubro
March 23, 20178 yr Author 40 minutes ago, diesieben07 said: Implement IWorldEventListener and register it to every (server) world in WorldEvent.Load. Then you will get notified via the onEntityRemoved method. right.. So This is my crushing class rn http://pastebin.com/na0sy5ui This is the Mod Class http://pastebin.com/9Kz1iS8X And this is my WorldEvent class http://pastebin.com/fydY3nGQ But I still get some errors. Sorry if I did some things utterly wrong. I'm new to modding
March 23, 20178 yr Author 9 minutes ago, diesieben07 said: No, you are new to Java. Basic Java knowledge is required for making a mod. Your code is not even remotely close to being valid Java code. Jeah sorry, I've only had a semester of java like 3 years ago and I haven't done any coding since. Sorry for wasting your time
March 23, 20178 yr Ok, I try to explain what I have investigated about the things diesieben7 said and what you are doing: 1. You use the FALSE event. You need to register/listen to the "WorldEvent.Load" and use getWorld(). Then you need to inject your IWorldEventListener using addEventListener. 2. You are getting Errors because you are implementing an Interface so you HAVE TO implement all given Methods. In your IWorldEventListener Class you are only overriding one Method. Not all Methods need a correct implementation only the ones you are using but you need to have the signatures in your Class. If you are using an IDE this should be easy to solve. I hope you can get your major mistakes now. P.S. dont quit now you may need to read and learn.
March 24, 20178 yr Author 19 hours ago, Pingubro said: P.S. dont quit now you may need to read and learn. Thanks Pingubro. And don't worry, I won't quit. I have fun trying to make a minecraft mod, even if I haven't coded for 3 years and forgot almost everything^^
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.