-
[Solved] Adding item to the game after registering
Yep, that did it... I rarely get to use annotations, other than @Deprecated, @Nullable and such vanilla ones. Thanks for your help.
-
I need help making my arrows destroy the blocks they hit
Don't take this too seriously, but I'd go for the following method: @SubscribeEvent public void regiterItems(ProjectileImpactEvent event) { if (event.getRayTraceResult().typeOfHit == RayTraceResult.Type.BLOCK){ //Destroy block here } } This would be the best event to go for, in my opinion. EDIT: For the block destruction, I'd try event.getEntity().getEntityWorld().setBlockToAir(event.getRayTraceResult().getBlockPos()); But I haven't tested it. I'm not even sure if event.getEntity() returns the player that shot the arrow....
-
[Solved] Adding item to the game after registering
For example, my common proxy: Would there be a problem in there ? It still won't work with your method.
-
[Solved] Adding item to the game after registering
Actually, I managed to add it to the game using the following code in my previous function: Is it correct to use this ? It seems to be working, but there might be a reason for you to use the @SubscribeEvent instead.
-
[Solved] Adding item to the game after registering
Alright, so I'm still not quite sure about how theses SubscribeEvent annotations... Your source code is quite long and seems to contain elements I do not need to use. I tried adding the following to my code: CommonProxy.java ClientProxy.java However, it would seem theses two are not even fired up. I'm sure there's something I should know but I don't know here...
-
[Solved] Adding item to the game after registering
Hi, so I just started out forge modding, with no prior knowledge of it. I have a good knowledge of java and have coded some plugins before, but this is my first time when it comes to modding. So, I'm trying to follow the official forge documentation. I kind of tried to register the item into the game, however it doesn't appear in the creative tab I set it to or using /give. Here is the code I have thus far: (Proxies are displayed in the same class, but they're not. Proxies: Main RegisterItems.java SimpleItem.java So, am I missing something out there ? I tried to follow the documentation's recommendation as to proxies, server/client side stuff. Apparently I should have used an Interface for CommonProxy but I thought an abstract class would be a better choice. If you find any other issues in the code, don't hesitate to let me know.
IPS spam blocked by CleanTalk.