Jump to content

positivevibes

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by positivevibes

  1. I managed to figure it out on my own. The result should be id, however the recipes folder should have been named recipe. Thank you anyways though
  2. { "type": "minecraft:crafting_shaped", "pattern": [ "i i", " R ", "i i" ], "key": { "i": { "item": "minecraft:iron_ingot" }, "R": { "item": "minecraft:redstone" } }, "result": { "id": "minecraft:iron_ingot" } } I'm having a problem where I've created a simple crafting recipe that takes in redstone dust and 4 iron ingots and returns an iron ingot (just for testing purposes). I have the file in my resouces/data/(modid)/recipes directory. However, the recipe does not work and I get no output when actually using a crafting table. Any help would be useful.
  3. So I actually managed to fix this issue. I have absolutely no idea why it suddenly started showing changes for me other than changing the createParticle method to create an instance of the particle before returning it.
  4. I'm having trouble with a custom particle I've made. The particle itself is registered and functions, however when I try to change any of its attributes in its constructor (size, color, etc...) I observe no changes whatsoever. I'm pretty confused, so I've included the code for the particle class here. Any help would be great. package com.gmail.damoruso321.bomb.particles; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.particle.Particle; import net.minecraft.client.particle.ParticleProvider; import net.minecraft.client.particle.SmokeParticle; import net.minecraft.client.particle.SpriteSet; import net.minecraft.core.particles.SimpleParticleType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; public class GasParticle extends SmokeParticle { protected GasParticle(ClientLevel p_107685_, double p_107686_, double p_107687_, double p_107688_, double p_107689_, double p_107690_, double p_107691_, float p_107692_, SpriteSet p_107693_) { super(p_107685_, p_107686_, p_107687_, p_107688_, p_107689_, p_107690_, p_107691_, p_107692_, p_107693_); // This doesn't work for some reason... this.rCol = 0f; this.gCol = 1f; this.bCol = 0f; this.quadSize *= 100f; } @OnlyIn(Dist.CLIENT) public static class Provider implements ParticleProvider<SimpleParticleType> { private final SpriteSet sprites; public Provider(SpriteSet p_107696_) { this.sprites = p_107696_; } public Particle createParticle(SimpleParticleType p_107707_, ClientLevel p_107708_, double p_107709_, double p_107710_, double p_107711_, double p_107712_, double p_107713_, double p_107714_) { return new GasParticle(p_107708_, p_107709_, p_107710_, p_107711_, p_107712_, p_107713_, p_107714_, 1.0F, this.sprites); } } }
  5. I think I've finally got it working. Thanks for helping with this issue it was quite a learning experience lol
  6. Can’t believe I missed that ty, I’ll update the code when I’m able to hopefully no more issues after that lol
  7. Yes it should be registered? Here's the link to the github: https://github.com/positivevibes123/MinecraftExplosiveMod hopefully it should be public. I have everything registered in the MyMod.java file. The other java files of interest are ModDataComponents.java and RemoteItem.java
  8. Thanks. I removed the data component from item registration and the game boots fine now. However now when I try to call the set() method on my item stack during the item's useOn method, it still throws an error that the registry object is not present. I have registered the data component along with all of my other modded content in the main mod class, so I am at a genuine loss as to why this is still happening. I am new to these forums, am I allowed to link the github repo?
  9. Okay, so I got everything set up and should have my data component registered. However when I try to register my modded item with the data component added to it, I get an error saying that the registry object (for the data component) is not present. I tried changing the order in which things are registered in the mod startup to no avail.
  10. Wow this looks a lot simpler than I thought it would be. Especially compared to the setup I had to do for capabilities. I'll look at all this and update if I have any issues ty
  11. Okay, I'm glad I made a backup then. I'm confused as to where there is any information on how to work with Data Components. I don't see anything about it on the Forge docs or any tutorials on this in general unless I'm missing it somehow. I can see the DataComponents decompiled class file but I'm not sure how to work with it. Maybe it's beyond my technical expertise?
  12. Okay, so I actually downgraded the mod to 1.20.6 because I did not want to have to deal with vanilla datacomponents. I followed a youtube tutorial and now have a capability I made attach to my modded item. However I am now unsure how to actually retrieve and manipulate the capability of an itemstack. I saw a getCapability function in some tutorials but that seems to have been deprecated...
  13. Upon further inspection of the wiki I have discovered Capabilities which seems to suit my needs instead. Apologies.
  14. I'm a bit confused as how to get/store custom nbt data in itemstacks on the fly in version 1.21. After a lot of googling I have found that in the past the ItemStack class had the functions getTagCompound() and setTagCompound(), however they seem to have been deprecated? It's unfortunate because that seemed so straight forward and I can't find much info on the subject otherwise. Apologies if this isn't worded nicely as I am still pretty new to minecraft modding. Any help would be appreciated.
×
×
  • Create New...

Important Information

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