Jump to content

xanderindalzone

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by xanderindalzone

  1. I tested onItemUse method, but its only calling when I'm NOT aiming(holding left) with the Gun Item targeting a block. In Adventure mode the Gun is behaving as I want to, because mining is disabled.... could I do that in survival when the player hold the Gun Item?
  2. I've checked and swords behave exactly as my Gun right know, the only issue now is that it doesnt shoot(onItemRightClick method) when I hold left click in survival with a Gun pointing to any block in range for mining
  3. I fixed the bug by overriding this method in the Gun's class and removing the others that prevented mining: but now it doesnt call onItemRightClick(shoot) when the player is aiming(holding left click) while looking to a non-solid block(glass, flower, etc). And by the way, is there a way to also set destroy speed to 0 on creative while holding the item? because if I remove the left click interaction on creative it still lags the player movement while aiming and looking to any block.
  4. Hi, I have a weird issue, I dont know why but when I hold left click with a Gun Item(to aim) in the main hand, looking at grass, flowers, or torches, the player gets stuck and cant move until I stop holding left click or stop looking at the grass, flower, torch, etc,.... How could I fix this? I think i've checked all the methods from the Gun class and all the events that relate to this issue, but none is making this happen. PD: in creative mode it has a different, it just causes the player movement to lag, and its triggered by holding left click with any block. Here's the repo: Gun class Footage:
  5. wait, i think i know why its crashing, ITooltipFlag is an only client class 🤦‍♂️
  6. This was probably going to happen on first attempt, but when I run my mod 1.0 on my local server, its crashing and I dont know exactly why. Here's the repo and latest.log:
  7. soooo, is it ok if I declare all the items and then, initializing them in Common first, and then calling the sorted list initializing the list? But, is fill() method from ItemGroup called after Common?
  8. are you saying this because "Array.asList();" may run before the items are initialized?
  9. Still a static initializer. ohhh you mean this method? if it isnt, please, tell me where's the "static" issue because thats the only static I see 😅
  10. is this ok now? I'm using the first List I had, List<Item>, because you said the issue was in the "static" initializing thing. I'm creating a new SortedItemList object in CommonSetup so I can get the predifined List for the Comparator, then I use the Mod Class instance field to access that mod object's Comparator field. its still working as expected ingame at least 😅 Overriden method in the ItemGroup class:
  11. Can I return the list from a static method instead, like this? this static variable is in the Mod's class if its not posible, how do I deal with this error changing the List<Item> to List<RegistryObject>? like you said here
  12. thx for the guide... and thx for the update... its working For anyone interesed on the end result, here it is: 1.I made a class to store the static comparator with a static list with all the items in the order I want 2. I overriden the fill() method in the CustomTab class that I wanted to sort, sorting the item list after calling super:
  13. what is the equivalent in 1.15.2 to the method "displayAllRelevantItems" from ItemGroup?
  14. Hi, I was wondering, is there a way to fix/update the order of mod items in the world, without having to create a new world? Because everytime I add a new item and I re-sort the item order when they register, the world doesnt follow the current order in code.
  15. LOL, thx for the extra info, i didnt even know that was a thing XD
  16. thx, before adding the text, I cleared all the stuff from the array and added the displayName, and then my description... and its working btw, how could I add color to the text?
  17. I've seen a lot of posts about this topic but most were outdated, talking about overriding this method in your item's class: but the tooltip field was List<String>, so I dont know how to deal with ITextComponent. I also saw another post where they recomended using this event.... but I dont know which is the correct tag, or if i'm doing it correctly or not... this probably sounds like an easy thing/topic but I cant find the anwser anywhere😅
  18. ok, i've managed to fix my issue by getting the block hit coords and setting the entity pos to these hit coords, and its working The impact effect is always reacting as expected, but sometimes, rarely, particles dont spawn, but the sound effect does play properly, so thats a bit weird.
  19. Yep, it has something to do with the bullet speed, I made the bullet a lot slower and its reacting always as expected when it hits glass etc etc, but I obviously cant make the bullet go slow, it wouldnt feel like a real gun anymore.... Is there a way to make the game update the bullet position faster?
  20. Sometimes when I shoot a bullet and it hits a glass block, it acts like it hits ground, or sometimes it traspasses it. I have coded the bullet to break vanilla glass and spawn particles when it hits IRON material blocks, which does,.... sometimes... Could it be that the bullet's position is not updating in time before it hits? PistolBulletEntity class Init entities White cloud is the ground impact event and the crit particles are the iron material effect(thats armored glass)
  21. Oh yeah, I'm dumb, I copypasted the code and forgot to change the method name in the parameter :P, thx XD I sometimes change code too fast that I dont realize of these silly mistakes XD Its now joining the world without crashes thx
  22. Now I'm getting this null exception when I join the world :V (CODE UPDATED on Github) Isnt this the way it has to be implemented? PD: I think I got this line from another post.
  23. I'm getting a null error when I try to get the player's custom capability, I dont know why.... I must have missed something but I dont know where.... if someone could tell where's the problem i would be grateful. Main Mod class Capability package with providers Event that attatches capabilities to the player Event Handler where I call the capability
×
×
  • Create New...

Important Information

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