Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

urbanxx001

Members
  • Posts

    181
  • Joined

  • Last visited

Everything posted by urbanxx001

  1. Forgive me, Idk much about changing physics, but given you've been waiting 3 hours, you deserve a reply. Hopefully someone more experienced will give advice. Your formatting is fine, no worries. If you're willing to post your code, we can help you debug it. When you say it's only working graphically, do you mean the entity/block rendering obeys your new physics, but not their bounding boxes/hit boxes? Also is this affecting vanilla blocks/entities, or only ones created in your mod?
  2. Below are my capability classes for attaching to vanilla living entities (besides player). I'd like to change the entity's capability (to a value of 1.0F) when right clicking with a mod item. I thought this would be accomplished with: target.getCapability(ModCap.MOD_CAP).ifPresent(IModCap::set); But checking the values before and after with: System.out.println(target.getCapability(ModCap.MOD_CAP).orElse(new ModCapMethods()).get()); Still yields 0.0F (the default value). Since it returns the default, the capability should be registered (so ifPresent should pass?), but I could be wrong. ModCap Class ModCapStorage Class ModCapMethods Class IModCap Class ModItem Class
  3. Ah so its in that class, I'll look more closely then. Thanks!
  4. For a custom recipe, I recommend taking a look at the RepairItemRecipe class in the source. However if your item is a weapon, tool, or armor that extends an existing archetype like a sword, helmet, etc, then it should automatically implement that recipe (combining durability in crafting table). If you want to add the anvil version of this, you can override the getIsRepairable() method in your item class. If you want more info on registering a custom recipe, lmk.
  5. This is an excellent post detailing the steps. It says to install DCEVM and the Hot Swap plugin, but another user claims only the first one is necessary. I followed the same steps, but wasn't able to see any edits in-game. Perhaps it'll work for you though (if it does, lmk)
  6. Which class(es) handle(s) the Ender Dragon's purple light upon death? this is outdated but it mentions a layer class, I've looked through the current ones but none referring to the ender dragon.
  7. Right you can store that in the key... sorry for the stupid questions. All set now. Edit: Oml I just realized getItem and setItem are the built-in methods for itemstack data 🤦. I've used getItem before but it never occured to me that it was for a data key.
  8. I appreciate all your help. I've created a data key in the entity class which is being updated, but I'm not sure how to link it with the tag in the item class (responsible for the property override). Either that or the key needs to be accessed from the item class too. Alternatively I've tried an if statement in the override method, to detect when an entity is created and tell it to grab a float from the entity class instead. This works, but it updates all modItemEntities in the world as it's not an instance of the current item. ModItemEntity with Data Key https://pastebin.com/TeQMiEKf
  9. After looking at the ItemEntity class as you suggested, it seems to handle syncing with EntityDataManager. However, getShareTag and readShareTag also exist, as well as onEntityItemUpdate in the item class. Which of these would be the best option?
  10. You could do the following: Map<Effect, EffectInstance> potionMap = entityLiving.getActivePotionMap(); if (potionMap.containsKey(Effects.EFFECT_NAME)) { // Do something }
  11. Ah ok I'll take look, thanks! I figured the packet would handle it, but now I realize the one I have is only for spawning.
  12. ModItem Class: https://pastebin.com/3ZR4XkXE ModItemEntity Class: https://pastebin.com/9KywYMWr
  13. Going off of what Ash said, a soft dependency is easy to implement. Below is one way. In your build.gradle, if you add the following plugin line at the top: apply plugin: 'maven-publish' Then in the dependencies section of the same file you can add a line such as (if we were adding the JEI mod): implementation fg.deobf("curse.maven:jei:2995910") Where the string of numbers is part of the web address for the specific version of the mod on curseforge. Then when you refresh your workspace, the mod should download as an external library (if the source is available). The plugin is also used for publishing to a maven repository, but the repository function isn't necessary if you're only using it to add a soft dependency (if you want to use it in that way though, go ahead)
  14. During the tick method in an item's entity class, I'm altering the item's custom NBT tags. The tags are being updated, but the method tied to one of them that handles a property override, isn't. (no texture change is seen). The model files are correct, as the override works in a SpecialRecipe class. What could be the issue? Idk if it's related to this by chance (although that deals with capabilities).
  15. Oh no that sounds like capability stuff lol. Maybe I'll stick with separate classes then. I'll fix the map as you suggested though. Thanks!
  16. In my projectile entity class, getDefaultItem is: @Override public Item getDefaultItem() { HashMap<Float, Item> itemMap = new HashMap<>(); itemMap.put(1F, ModItems.ITEM_1); itemMap.put(1.25F, ModItems.ITEM_2); itemMap.put(1.5F, ModItems.ITEM_3); itemMap.put(1.75F, ModItems.ITEM_4); itemMap.put(2F, ModItems.ITEM_5); System.out.println("floatField: " + floatField); return itemMap.get(floatField); } Where floatField is a (non-final) field initialized in the constructor. However, floatField returns zero in this method, even though it returns the correct nonzero value in a method like onImpact, which is also an override. Is this a simple fix, or should I settle for separate entity classes for each ModItem that extend this base class?
  17. Same thing for me... I've tried with both the hotswap plugin and without, and no changes occur. I've verified everything is setup correctly. Also not sure of the difference between "Recompile" under Build, and "Reload Changed Classes" under debug actions (I assume it makes no difference in debug mode?). Or if only certain changes are detected during runtime.
  18. I'm sorry I don't know what to tell you. I can't imagine how frustrating it is. If you want to transfer your builds from the old world to a new one, you can use structure blocks.
  19. Ah ok, thank you so much! I'll create a packet and cover both events then.
  20. Ok then try that. In general, if no mods are installed and the portals still don't work, then the world is probably corrupted.
  21. It's not for interacting with another entity though, which is why I'm using PlayerInteractEvent$RightClickEmpty. Or are you recommending the other two methods as they can access ServerPlayerEntity? My main issue is getting the server player. I can already get the slot from player.getItemStackFromSlot(EquipmentSlotType.CHEST);
  22. I agree with a lot of your points Ash But not everything has to be done by brute-forcing your way through MC source code. There's no reason to suffer if there's an existing model and it's done right. The code of popular mods worked on by large teams, are usually done right. And vanilla sometimes uses practices that mods can't access. Otherwise, yes vanilla is an invaluable tool.
  23. Ok so the Nether works but not the End when you restore them from the previous version, i.e. moving those folders from pre-1.16.3 to the post-1.16.3 world. So when you tried travelling to the End in 1.16.3, there were no mods installed but you used the modded world, correct?
  24. Given your execute command didn't find the nether or end, it's safe to say they don't exist anymore. You said you tried copying the Level.dat files and nothing happened, did you try copying over the dimension folders from before the update to the new world as well?
  25. You'll want to implement custom VoxelShapes for different blockstates in your block class. It might be helpful to extend FenceBlock if you want to use some of the logic already present there. You might first want to create the block model(s) in a program like BlockBench, and then get the model coordinates from there to put in the class. I recommend TechnoVision's tutorial on custom block models. It's also helpful to look at vanilla classes.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.