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


  • Posts

  • Joined

  • Last visited

Posts 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?

    • Like 1
  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:


    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. 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. 

  4. On 10/17/2020 at 12:01 PM, KidKoderMod033109 said:

    I'm wondering how I can do this myself?

    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)

    • Like 1
  5. 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

  6. 22 hours ago, diesieben07 said:

    Look at ItemEntity for how it does it.

    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?

  7. 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)

  8. 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). 

  9. In my projectile entity class, getDefaultItem is:

    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?

  10. On 4/22/2020 at 6:55 AM, RepubliCity said:

    I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

    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. 

  11. 1 hour ago, ockerspock said:

    I have not tried the End with all the mods removed

    Ok then try that. In general, if no mods are installed and the portals still don't work, then the world is probably corrupted.

  12. 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);

  13. I agree with a lot of your points Ash

    21 hours ago, ChampionAsh5357 said:

    you're more or less trying to find an answer without attempting to dive into the source code of Minecraft and problem solve your way through it.

    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. 

  14. 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?

  15. 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?

  16. 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.