Jump to content

xanderindalzone

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by xanderindalzone

  1. I managed to upload the full project to that same repo, I had to update the paths in the Run .launch files to be able to run the game from eclipse again because I had to clone the repo to a different local folder because it didn't let me push the changes of my existing folder where the project was at. I hope you can test it yourself and tell me how to stop the item from spamming bullets while holding right click, cus for the current gun I only what it to fire once each right click since its semi automatic. PD: Ignore the "Reloading" message that pops up everytime the gun shoots, i forgot to remove that since that part of the code is not ready.
  2. I know I still have some broken attributes in the GunBase class, I'll fix them later... By the way, the PASS type didn't seem to cancel the item use animation, but the FAIL type does cancel it. But the animation is still playing when the item damage is updating(when the gun fires or reloads). PD: I didn't have time to properly upload the project to the repo, but all the java classes are there.
  3. thx for that tip, i'll test that tomorrow
  4. Because when I used "event.setCanceled(true);" in the event method to cancel the "use item animation" it was also canceling "onItemRightClick" method.
  5. The Gun Event that calls the Gun using method: (I was using this event method instead of the item method because I didnt want the gun to do the default use animation) (I temporaly disabled the setCanceled() line to see if that was causing the "onPlayerStoppedUsing" not working) Gun class: PD: I know I have some broken code, i'll fix that later
  6. I extended the gun class from BowItem but this method which it says its supposed to be called when you stop holding right click with the item(Gun in this case), its never being called.
  7. So let me get this clear.... all the events located in the package "package net.minecraftforge.client.event;" are ONLY called in client-side? so is it safe to use Minecraft.getInstance() in those?
  8. Is there an alternative to Minecraft.getInstance()? Because there are some events where I need to access what's the item that the player is holding and I dont know how to access the player with the event Object. Here for example: Would "@OnlyIn(Dist.CLIENT)" work? I asume that makes the method call only in client but I could be wrong XD Also I dont know if this code prevents the mod in servers from running the event code, to prevent the server to access the Minecraft.getInstance(), i just found the code in some random post XD: PD: the event displays the ammo left in the mag when the player is holding a gun
  9. Hi, I had these variables in my Gun's class but I believe these wont work properly and can bug every Gun item ingame, since these 4 variables can change in the code. I think I can recode the last 3 variables inside methods so they work the same, but I dont know how to recode the "ticks_trigger_pressed" variable to make it work exactly the same so it doesn't bug the rest of guns in the game. I really need it to make the gun fire in semi auto mode. That variable counts the ticks that the ItemUseBindingKey is pressed. Here are the Gun methods where I use this variable: PD: the second method doesnt have @Override because I use it calling it from an event. Is there any other way that I can achieve this without using Object attribute variables in the Guns Class?
  10. IT'S FINALLY RENDERING!! :V For the people that have the same issue.... I extended PistolBulletEntity from AbstractArrowEntity instead of ArrowEntity... also.... I changed this method in the PistolBulletEntity Class(to fix the invisible spawning): to.... And to fix the constantly Arrow spawn instead of my custom entity, I changed this constructor parameter when I was creating the entity in the Gun Class: to... The Init.PISTOL_BULLET_ENTITY is the EntityType<PistolBulletEntity> variable I created in the Init class. FOOTAGE PD: now I have to fix the issue that make some bullets bounce back or bug in midair.... is there a way to kill the entity when it hits the ground or another entity?
  11. I just started modding last month, I'm doing stuff how I learned on youtube, no need to be like that :c
  12. PD: I just posted the same message accidentaly when i refreshed the post, I dont know why :V (EDITED)
  13. this is something I'll fix later, I did notice a while ago when I was modding in back 1.12. But still, I dont know why the BulletEntityArrow is spawning a normal ArrowEntity model/texture. BTW, I just realized the entity is spawning as an invisible arrow using the command /summon. So it appears to be registering now the entity, but why does the entity render a Vanilla arrow when I use the gun and when I use the command it spawns an invisible arrow?
  14. Hi, back in 1.12.2 I made a custom arrow following a tutorial on youtube. Now that I'm updating everything to 1.15.2, the guy that made that tutorial hasn't shown how to do it in 1.15.2. I'm trying to update the bullet entity code, which extends from EntityArrow, but I can't get it to render the bullet texture, its rendering the minecraft arrow texture all the time. I've checked the log, and it appears that the render is not registering, but I dont know where update the code to fix the issue. Here are my classes, I probably have something wrong or missing, I'm not very good with registries or renders. MAIN CLASS: INITIALIZER CLASS BULLET ENTITY CLASS BULLET RENDER CLASS GUN METHOD WHERE THE BULLET IS FIRED There are some lines of code that I've found in other posts that I dont know if I have the correct parameters, so let me know if I have an incorrect parameter in any of the bullet stuff methods.
  15. I found this website with a bunch of PlayerRenderEvent examples and.... LMAO..... it only took 1 CODE LINE to make the player render as I wanted when it was holding the gun. WEBSITE: https://www.programcreek.com/java-api-examples/?api=net.minecraftforge.client.event.RenderPlayerEvent Literally, just this line of code: making the arm and the item copy the render when the player aims with an arrow, the result is just perfect tomorrow i'll try to render the left arm as normal, which will be easy I guess. But now I can finally progress with this thing done XD Footage of the Gun with proper rendering: https://gyazo.com/de87cfcb79dea7b565013077cb77bb04 thx for the help, I guess this topic is now solved
  16. Sorry, I'm trying to understand the layer code stuff, but a bit lost, it's the first time I "try" to work with layers. Could you kindly show me the classes and highlight the code that makes posible to modify position and rotation of the item in the player's hand in third person view? (just the item rendering, I got the player model rendering fine for now).... that way I could study how does the layer code work etc etc.... I'm looking everywhere to find a solution but i'm not getting any progress :c This is my actual rendering code, just in case someone wants to see it:
  17. Exactly, I want the gun to follow the body's YAW and the head's PITCH(removing the walking bobbing animation) to match the Arms Pos./Rot. How could I do that exactly? Is there a wiki or example code somewhere?
  18. thx for the debug tip, the rotation and pose are pretty much done, but how do I make the gun Item follow the new rendered arm position/rotation?
  19. thx for the help, at least i'm doing some progress now XD (actual event method), this is the first attempt XD:
  20. could I see your classes to see how you did it? the custom model render thing to override the vanilla player model the custom model class and how did you register that custom model.... i'm not very good understanding render stuff XD
  21. Hi, I was trying to make my player look like it was holding a Gun type Item, I saw a couple of topics, wrote a bit of code in the Player render Pre event, but it doesn't do anything, the only thing it changes is when i make the arm not visible, this my GunEvents code: any help would be grateful :), thx
  22. Hi, I was wondering, is there a way to cancel the bobbing animation when you right click/use an item, same as if you use this code in the "item's class" to disable the left click animation:
  23. ok fixed it by adding .notSolid() in the block's properties
  24. I tried it before but I was getting errors, maybe I didn't do it correctly, I 'll check the post again XD
  25. This helped me with the transparent texture issue, thx. And this helped me with the drops.... also thx now I have the no floor issue XD... how do I fix this in 1.15? XD
×
×
  • Create New...

Important Information

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