Jump to content

positivevibes

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by positivevibes

  1. {
      "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.

  2. 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);
            }
        }
    }

     

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

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

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

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

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