Jump to content

Recommended Posts

Posted

I'm trying to emulate a thrown item, the snowball.

 

The item I made shows up in game, can be held in hand, and on right-click gets thrown properly, but the projectile is invisible.  I know it impacts because it explodes in-world.

 

But the item does not render in-world.  I've seen tutorials for this, and other posts in this forum, but all these tutorials and posts use their own models as the entity to render.  I simply want to render the sprite and have that thrown, the way the snowball does.  I've copied the snowball's code almost exactly (changing only what needs to be changed), but the doRender method never gets called.

 

I System.out.println()'d my way through and the constructor in the renderer gets called.  But nothing ever reaches doRender.

 

This is all set up precisely like the snowball, so I'm confused.

 

ItemExplodets.java

package x.thealphaelement.item;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import x.thealphaelement.entity.EntityExplodets;

public class ItemExplodets extends Item {
public ItemExplodets(int par1)
    {
        super(par1);
        this.maxStackSize = 64;
        this.setCreativeTab(CreativeTabs.tabMisc);
        setUnlocalizedName("explodets");
    }

public void registerIcons(IconRegister iconRegister) {
        itemIcon = iconRegister.registerIcon("TheAlphaElement:explodetsHeld");
}

    /**
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
     */
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        if (!par3EntityPlayer.capabilities.isCreativeMode)
        {
            --par1ItemStack.stackSize;
        }

        par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

        if (!par2World.isRemote)
        {
            par2World.spawnEntityInWorld(new EntityExplodets(par2World, par3EntityPlayer));
        }

        return par1ItemStack;
    }

}

 

 

EntityExplodets.java

package x.thealphaelement.entity;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;

public class EntityExplodets extends EntityThrowable {

public EntityExplodets(World par1World)
    {
        super(par1World);
    }

    public EntityExplodets(World par1World, EntityLiving par2EntityLiving)
    {
        super(par1World, par2EntityLiving);
    }

    public EntityExplodets(World par1World, double par2, double par4, double par6)
    {
        super(par1World, par2, par4, par6);
    }

@Override
protected void onImpact(MovingObjectPosition movingobjectposition) {
	this.worldObj.newExplosion(getThrower(), this.posX, this.posY, this.posZ, 1.0f, false, false);
	this.setDead();
}

}

 

 

RenderExplodets.java

package x.thealphaelement.client.renderer.entity;

import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.Icon;

import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;

import x.thealphaelement.TheAlphaElement;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class RenderExplodets extends Render {

private Item field_94151_a;
    private int field_94150_f;

    public RenderExplodets(Item par1, int par2)
    {
        this.field_94151_a = par1;
        this.field_94150_f = par2;
        System.out.println("Constructor RenderExplodets: " + this.field_94151_a + " // " + this.field_94150_f);
    }

    public RenderExplodets(Item par1)
    {
        this(par1, 0);
    }

    public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    	Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);
    	System.out.println("Rendering!"); // This never gets called!  It's supposed to be called when throwing the item.

        if (icon != null)
        {
            GL11.glPushMatrix();
            GL11.glTranslatef((float)par2, (float)par4, (float)par6);
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            GL11.glScalef(0.5F, 0.5F, 0.5F);
            this.loadTexture("/gui/items.png");
            Tessellator tessellator = Tessellator.instance;

            if (icon == ItemPotion.func_94589_d("potion_splash"))
            {
                int i = PotionHelper.func_77915_a(((EntityPotion)par1Entity).getPotionDamage(), false);
                float f2 = (float)(i >> 16 & 255) / 255.0F;
                float f3 = (float)(i >> 8 & 255) / 255.0F;
                float f4 = (float)(i & 255) / 255.0F;
                GL11.glColor3f(f2, f3, f4);
                GL11.glPushMatrix();
                this.func_77026_a(tessellator, ItemPotion.func_94589_d("potion_contents"));
                GL11.glPopMatrix();
                GL11.glColor3f(1.0F, 1.0F, 1.0F);
            }

            this.func_77026_a(tessellator, icon);
            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
            GL11.glPopMatrix();
        }
    }

    private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon)
    {
        float f = par2Icon.getMinU();
        float f1 = par2Icon.getMaxU();
        float f2 = par2Icon.getMinV();
        float f3 = par2Icon.getMaxV();
        float f4 = 1.0F;
        float f5 = 0.5F;
        float f6 = 0.25F;
        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        par1Tessellator.startDrawingQuads();
        par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
        par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
        par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
        par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
        par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
        par1Tessellator.draw();

    }
}


 

ClientProxy.java

package x.thealphaelement.client;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import x.thealphaelement.CommonProxy;
import x.thealphaelement.TheAlphaElement;
import x.thealphaelement.client.gui.GuiMerchantBlock;
import x.thealphaelement.client.renderer.RenderBlazeModded;
import x.thealphaelement.client.renderer.RenderCreeperModded;
import x.thealphaelement.client.renderer.RenderEndermanModded;
import x.thealphaelement.client.renderer.RenderGhastModded;
import x.thealphaelement.client.renderer.RenderSkeletonModded;
import x.thealphaelement.client.renderer.RenderSpiderModded;
import x.thealphaelement.client.renderer.RenderWitchModded;
import x.thealphaelement.client.renderer.RenderZombieModded;
import x.thealphaelement.client.renderer.entity.RenderExplodets;
import x.thealphaelement.entity.EntityExplodets;
import x.thealphaelement.entity.monster.EntityBlazeModded;
import x.thealphaelement.entity.monster.EntityBlueSkeleton;
import x.thealphaelement.entity.monster.EntityBlueSpider;
import x.thealphaelement.entity.monster.EntityBlueZombie;
import x.thealphaelement.entity.monster.EntityCaveSpiderModded;
import x.thealphaelement.entity.monster.EntityCreeperModded;
import x.thealphaelement.entity.monster.EntityEndermanModded;
import x.thealphaelement.entity.monster.EntityGhastModded;
import x.thealphaelement.entity.monster.EntityPigZombieModded;
import x.thealphaelement.entity.monster.EntityRedSkeleton;
import x.thealphaelement.entity.monster.EntityRedSpider;
import x.thealphaelement.entity.monster.EntityRedZombie;
import x.thealphaelement.entity.monster.EntitySkeletonModded;
import x.thealphaelement.entity.monster.EntitySpiderModded;
import x.thealphaelement.entity.monster.EntitySpiderling;
import x.thealphaelement.entity.monster.EntityWitchModded;
import x.thealphaelement.entity.monster.EntityZombieModded;
import x.thealphaelement.tileentity.TileEntityMerchantBlock;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;

public class ClientProxy extends CommonProxy {
        
        @Override
        public void registerRenderers() {
        	RenderingRegistry.registerEntityRenderingHandler(EntitySkeletonModded.class, new RenderSkeletonModded());
            EntityRegistry.registerGlobalEntityID(EntitySkeletonModded.class, "NormalSkeleton", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityZombieModded.class, new RenderZombieModded());
            EntityRegistry.registerGlobalEntityID(EntityZombieModded.class, "NormalZombie", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntitySpiderModded.class, new RenderSpiderModded());
            EntityRegistry.registerGlobalEntityID(EntitySpiderModded.class, "NormalSpider", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityCreeperModded.class, new RenderCreeperModded());
            EntityRegistry.registerGlobalEntityID(EntityCreeperModded.class, "NormalCreeper", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityEndermanModded.class, new RenderEndermanModded());
            EntityRegistry.registerGlobalEntityID(EntityEndermanModded.class, "NormalEnderman", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityCaveSpiderModded.class, new RenderSpiderModded());
            EntityRegistry.registerGlobalEntityID(EntityCaveSpiderModded.class, "NormalCaveSpider", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityWitchModded.class, new RenderWitchModded());
            EntityRegistry.registerGlobalEntityID(EntityWitchModded.class, "NormalWitch", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityBlazeModded.class, new RenderBlazeModded());
            EntityRegistry.registerGlobalEntityID(EntityBlazeModded.class, "NormalBlaze", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityGhastModded.class, new RenderGhastModded());
            EntityRegistry.registerGlobalEntityID(EntityGhastModded.class, "NormalGhast", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityPigZombieModded.class, new RenderZombieModded());
            EntityRegistry.registerGlobalEntityID(EntityPigZombieModded.class, "NormalPigZombie", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityRedZombie.class, new RenderZombieModded());
            EntityRegistry.registerGlobalEntityID(EntityRedZombie.class, "RedZombie", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityBlueZombie.class, new RenderZombieModded());
            EntityRegistry.registerGlobalEntityID(EntityBlueZombie.class, "BlueZombie", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityRedSkeleton.class, new RenderSkeletonModded());
            EntityRegistry.registerGlobalEntityID(EntityRedSkeleton.class, "RedSkeleton", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityBlueSkeleton.class, new RenderSkeletonModded());
            EntityRegistry.registerGlobalEntityID(EntityBlueSkeleton.class, "BlueSkeleton", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityRedSpider.class, new RenderSpiderModded());
            EntityRegistry.registerGlobalEntityID(EntityRedSpider.class, "RedSpider", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityBlueSpider.class, new RenderSpiderModded());
            EntityRegistry.registerGlobalEntityID(EntityBlueSpider.class, "BlueSpider", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntitySpiderling.class, new RenderSpiderModded());
            EntityRegistry.registerGlobalEntityID(EntitySpiderling.class, "Spiderling", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
            RenderingRegistry.registerEntityRenderingHandler(EntityExplodets.class, new RenderExplodets((Item)TheAlphaElement.explodets));
            EntityRegistry.registerGlobalEntityID(EntityExplodets.class, "Explodets", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
            
       }
        
        public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
        	if (tileEntity != null) {
        		switch(ID) {
        			case 0: return new GuiMerchantBlock(player, (TileEntityMerchantBlock)tileEntity); // your GUIs go here
        		}
        	}
        	return null;
        }
        
}

 

 

CommonProxy.java

package x.thealphaelement;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import x.thealphaelement.client.gui.ContainerMerchantBlock;
import x.thealphaelement.tileentity.TileEntityMerchantBlock;
import cpw.mods.fml.common.network.IGuiHandler;

public class CommonProxy implements IGuiHandler {
        
	// Client stuff
        public void registerRenderers() {
                // Nothing here as the server doesn't render graphics!
        }

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		return null;
	}

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
		if (tileEntity != null) {
			switch(ID) {
				case 0: return new ContainerMerchantBlock(player.inventory, (TileEntityMerchantBlock)tileEntity); // your Containers go here
			}
		}
		return null;
	}

        
}

 

Base mod class:

package x.thealphaelement;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.MinecraftForge;

import org.lwjgl.input.Keyboard;

import x.thealphaelement.block.BlockBedModded;
import x.thealphaelement.block.BlockGlassModded;
import x.thealphaelement.block.MerchantBlock;
import x.thealphaelement.client.keybinding.HealthPotionKeyBind;
import x.thealphaelement.entity.monster.EntityBlazeModded;
import x.thealphaelement.entity.monster.EntityBlueSkeleton;
import x.thealphaelement.entity.monster.EntityBlueSpider;
import x.thealphaelement.entity.monster.EntityBlueZombie;
import x.thealphaelement.entity.monster.EntityCaveSpiderModded;
import x.thealphaelement.entity.monster.EntityCreeperModded;
import x.thealphaelement.entity.monster.EntityEndermanModded;
import x.thealphaelement.entity.monster.EntityGhastModded;
import x.thealphaelement.entity.monster.EntityPigZombieModded;
import x.thealphaelement.entity.monster.EntityRedSkeleton;
import x.thealphaelement.entity.monster.EntityRedSpider;
import x.thealphaelement.entity.monster.EntityRedZombie;
import x.thealphaelement.entity.monster.EntitySkeletonModded;
import x.thealphaelement.entity.monster.EntitySpiderModded;
import x.thealphaelement.entity.monster.EntitySpiderling;
import x.thealphaelement.entity.monster.EntityWitchModded;
import x.thealphaelement.entity.monster.EntityZombieModded;
import x.thealphaelement.eventhandlers.EntityJoinWorldHandler;
import x.thealphaelement.eventhandlers.EventSounds;
import x.thealphaelement.eventhandlers.GenerateMinableHandler;
import x.thealphaelement.eventhandlers.OverlayEventHandler;
import x.thealphaelement.item.GlassShard;
import x.thealphaelement.item.GlassSword;
import x.thealphaelement.item.ItemExplodets;
import x.thealphaelement.item.RedPotion;
import x.thealphaelement.tileentity.TileEntityMerchantBlock;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid="TheAlphaElement", name="The Alpha Element", version="0.2.4")
@NetworkMod(clientSideRequired=true, serverSideRequired=false) //, channels = {"TheAlphaElement"}, packetHandler = TheAlphaElementPacketHandler.class)

public class TheAlphaElement {
 // The instance of your mod that Forge uses.
    @Instance("TheAlphaElement")
    public static TheAlphaElement instance;
    
    // Monster spawning biomes.
    BiomeGenBase[] monsterSpawnBiomes = new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.beach, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills };
    private BiomeGenBase theNether = BiomeGenBase.biomeList[8];
    
    // Register materials here.
    private final static EnumToolMaterial GLASSMATERIAL = EnumHelper.addToolMaterial("GLASSMATERIAL", 0, 1, 6.0F, 35, 10);
    

    // Initialize items here.
    public static Item glassShard = new GlassShard(5000);
    public static Item glassSword = new GlassSword(5001, GLASSMATERIAL);
    public static Item redPotion = new RedPotion(5002);
    public static Item explodets = new ItemExplodets(5003);
    
    // Initialize blocks here.
    public final static Block merchantBlock = new MerchantBlock(500, 0, Material.wood);
    
    
    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="x.thealphaelement.client.ClientProxy", serverSide="x.thealphaelement.CommonProxy")
    public static CommonProxy proxy;
    
    @PreInit
    public void preInit(FMLPreInitializationEvent event) {
    	NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
    	instance = this;
    	
    	MinecraftForge.EVENT_BUS.register(new EventSounds());
    	
    	
    	KeyBinding[] key = {new KeyBinding("Use Red Potion", Keyboard.KEY_G)};
        boolean[] repeat = {false};
        KeyBindingRegistry.registerKeyBinding(new HealthPotionKeyBind(key, repeat));
    }
    
    @Init
    public void load(FMLInitializationEvent event) {
            proxy.registerRenderers();
            
            // NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());
           
            // Register new mobs.
            EntityRegistry.registerModEntity(EntitySkeletonModded.class, "Normal Skeleton", 32, this, 80, 3, true);
            // EntityRegistry.addSpawn(EntitySkeletonModded.class, 30, 2, 4, EnumCreatureType.monster, monsterSpawnBiomes);
            LanguageRegistry.instance().addStringLocalization("entity.NormalSkeleton.name", "Normal Skeleton");
            
            EntityRegistry.registerModEntity(EntityZombieModded.class, "Normal Zombie", 33, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalZombie.name", "Normal Zombie");
            
            EntityRegistry.registerModEntity(EntitySpiderModded.class, "Normal Spider", 34, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalSpider.name", "Normal Spider");
            
            EntityRegistry.registerModEntity(EntityCreeperModded.class, "Normal Creeper", 35, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalCreeper.name", "Normal Creeper");
            
            EntityRegistry.registerModEntity(EntityEndermanModded.class, "Normal Enderman", 36, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalEnderman.name", "Normal Enderman");
            
            EntityRegistry.registerModEntity(EntityCaveSpiderModded.class, "Normal Cave Spider", 37, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalCaveSpider.name", "Normal Cave Spider");
             
            EntityRegistry.registerModEntity(EntityWitchModded.class, "Normal Witch", 38, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalWitch.name", "Normal Witch");

            EntityRegistry.registerModEntity(EntityBlazeModded.class, "Normal Blaze", 39, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalBlaze.name", "Normal Blaze");

            EntityRegistry.registerModEntity(EntityGhastModded.class, "Normal Ghast", 40, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalGhast.name", "Normal Ghast");
            
            EntityRegistry.registerModEntity(EntityPigZombieModded.class, "Normal Pig Zombie", 41, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.NormalPigZombie.name", "Normal Pig Zombie");
            
            EntityRegistry.registerModEntity(EntityRedZombie.class, "Red Zombie", 42, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.RedZombie.name", "Red Zombie");
            
            EntityRegistry.registerModEntity(EntityBlueZombie.class, "Blue Zombie", 43, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.BlueZombie.name", "Blue Zombie");
            
            EntityRegistry.registerModEntity(EntityRedSkeleton.class, "Red Skeleton", 44, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.RedSkeleton.name", "Red Skeleton");
            
            EntityRegistry.registerModEntity(EntityBlueSkeleton.class, "Blue Skeleton", 45, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.BlueSkeleton.name", "Blue Skeleton");
            
            EntityRegistry.registerModEntity(EntityBlueSpider.class, "Blue Spider", 46, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.BlueSpider.name", "Blue Spider");
            
            EntityRegistry.registerModEntity(EntityRedSpider.class, "Red Spider", 47, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.RedSpider.name", "Red Spider");
            
            EntityRegistry.registerModEntity(EntitySpiderling.class, "Spiderling", 48, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.Spiderling.name", "Spiderling");
            
            // Register item names
            LanguageRegistry.addName(glassShard, "Glass Shard");
            LanguageRegistry.addName(glassSword, "Glass Sword");
            LanguageRegistry.addName(redPotion, "Red Potion");
            LanguageRegistry.addName(explodets, "Explodets");
           
            // Register recipes.
            GameRegistry.addRecipe(new ItemStack(TheAlphaElement.glassSword), "x", "x", "y",
                    'x', TheAlphaElement.glassShard, 'y', Item.stick);
            GameRegistry.addRecipe(new ItemStack(TheAlphaElement.merchantBlock), "www", "wew", "www",
                    'w', Block.planks, 'e', Item.emerald);
            
            //Register event listeners.
            MinecraftForge.EVENT_BUS.register(new EntityJoinWorldHandler());  // Handle spawning of entities.
            MinecraftForge.ORE_GEN_BUS.register(new GenerateMinableHandler());
            
            //Register blocks.
            
            GameRegistry.registerBlock(merchantBlock, "generalMerchant");
            LanguageRegistry.addName(merchantBlock, "General Merchant");
            
            /* These blocks of code replace default blocks with our own.  Our blocks inherit all default block
             * properties, but may also modify behaviors.
             * 1.  Remove the block from the array called blocksList.
             * 2.  Add our block class into that spot in the array.
             * 3.  Register the block with the game.
             */
            
            int glassID = Block.glass.blockID;
            Block.blocksList[glassID] = null;
            Block blockGlassModded = new BlockGlassModded(glassID, Material.glass, false);
            GameRegistry.registerBlock(blockGlassModded, "glass");
            
            int bedID = Block.bed.blockID;
            Block.blocksList[bedID] = null;
            Block blockBedModded = new BlockBedModded(bedID);
            GameRegistry.registerBlock(blockBedModded, "bed");
            
            // Register Tile Entities
            GameRegistry.registerTileEntity(TileEntityMerchantBlock.class, "generalMerchant");
    }
    
    @PostInit
    public void postInit(FMLPostInitializationEvent event) {
            // Stub Method
    	MinecraftForge.EVENT_BUS.register(new OverlayEventHandler(Minecraft.getMinecraft()));
    }
    
}

Posted

Solved.  The entity (in this case, EntityExplodets) must be registered in the base mod class.  I added the following code and now it's displaying properly.

 

EntityRegistry.registerModEntity(EntityExplodets.class, "Explodets", 49, this, 80, 3, true);
            LanguageRegistry.instance().addStringLocalization("entity.Explodets.name", "Explodets");

 

I'm not certain, currently, that the second line is needed, but I added it anyway.  Happy code wrangling!

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Rubidium and Embeddium are versions of the same mod, you can only have one. I believe Embeddium is the one that's actively maintained.
    • Hello, New to modding, but have a solid CS foundation. I've created multiple custom BlockEntities that all have the same issue, which is that the inventory only updates on right click (overriding the useItemOn method). I've seen multiple posts on here outlining a similar issue to mine, but I've already implemented the solution of: overriding the correct methods in the BlockEntity class and calling setChanged(). I've tried every different place for setChanged() to no success. I'm wondering if I'm missing something else or if there was some change to sending data to the client in 1.21.5? Or will I have to use a custom packet sender? Here is the code for one of my BlockEntity classes with a single inventory slot: public class MyCustomBlockEntity extends BlockEntity { public final ItemStackHandler inventory = new ItemStackHandler(1) { @Override protected int getStackLimit(int slot, @NotNull ItemStack stack) { return 1; } @Override protected void onContentsChanged(int slot) { setChanged(); if (!level.isClientSide()) { level.setBlockAndUpdate(getBlockPos(), getBlockState()); } } }; public MyCustomBlockEntity(BlockPos pPos, BlockState pBlockState) { super(ModBlockEntities.MY_CUSTOM_BE.get(), pPos, pBlockState); } public void clearContents() { inventory.setStackInSlot(0, ItemStack.EMPTY); } public void dropItem() { SimpleContainer inv = new SimpleContainer(inventory.getSlots()); inv.setItem(0, inventory.getStackInSlot(0)); Containers.dropContents(this.level, this.worldPosition, inv); } @Override public void setRemoved() { dropItem(); super.setRemoved(); } @Override protected void saveAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { super.saveAdditional(pTag, pRegistries); pTag.put("inventory", inventory.serializeNBT(pRegistries)); } @Override protected void loadAdditional(CompoundTag pTag, HolderLookup.Provider pRegistries) { super.loadAdditional(pTag, pRegistries); inventory.deserializeNBT(pRegistries, pTag.getCompound("inventory").get()); } @Override public Packet<ClientGamePacketListener> getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); } @Override public CompoundTag getUpdateTag(HolderLookup.Provider pRegistries) { return saveWithoutMetadata(pRegistries); } } Mostly encountering the issue when calling the clearContents() method anywhere outside of useItemOn() in the Block class. I've also tried overriding both the handleUpdateTag() and onDataPacket() methods, calling their super along with loadAdditional(), but neither changed the outcome. Thanks in advance for any replies.
    • Hi all! I’m working on a Jurassic Park-themed mod for Minecraft 1.20.1, aiming to include dinosaurs, fossils, DNA extraction, and cool machines. This is a free project, mainly passion-driven, and I’ll give full credit to everyone involved. this is the perfect opportunity for beginners of modeling and coding. This project will give you experience and a creative freedom If you love dinosaurs and Minecraft modding, hit me up! Thanks! Add Me ogfrost. <--- Discord
    • I'm just really confused. This bug only applies to modpacks made by me. i have tried using different launchers prism, modrinth etc. I have tried with multiple modpacks. All of this has not prevented this bug. Relevant part of log is here: [06Jun2025 16:18:49.882] [main/ERROR] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Failed to build unique mod list after mod discovery. net.minecraftforge.fml.loading.EarlyLoadingException: Duplicate mods found     at net.minecraftforge.fml.loading.UniqueModListBuilder.buildUniqueList(UniqueModListBuilder.java:87) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:106) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:164) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86) ~[loader-47.2.2.jar:47.2]     at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) ~[modlauncher-10.0.9.jar:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]     at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) ~[?:?]     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]     at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]     at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]     at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.Launcher.run(Launcher.java:88) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]     at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:67) ~[?:?]     at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:105) ~[?:?]     at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) ~[?:?]     at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[?:?] [06Jun2025 16:18:49.894] [main/ERROR] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Mod Discovery failed. Skipping dependency discovery.     Full log [06Jun2025 16:18:48.612] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, DeltaBlack_, --version, 1.20.1, --gameDir, C:/Users/sammi/AppData/Roaming/PrismLauncher/instances/SITE 111/minecraft, --assetsDir, C:/Users/sammi/AppData/Roaming/PrismLauncher/assets, --assetIndex, 5, --uuid, 0ff86c0727f444f1a926b954a58d8c44, --accessToken, ????????, --userType, msa, --versionType, release, --launchTarget, forgeclient, --fml.forgeVersion, 47.1.105, --fml.fmlVersion, 47.2.2, --fml.mcVersion, 1.20.1, --fml.mcpVersion, 20230612.114412, --width, 854, --height, 480] [06Jun2025 16:18:48.615] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Windows 11 arch amd64 version 10.0 [06Jun2025 16:18:49.050] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [06Jun2025 16:18:49.173] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [06Jun2025 16:18:49.311] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.6 got version 4.6 [06Jun2025 16:18:49.496] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/C:/Users/sammi/AppData/Roaming/PrismLauncher/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%23152!/ Service=ModLauncher Env=CLIENT [06Jun2025 16:18:49.502] [pool-2-thread-1/INFO] [EARLYDISPLAY/]: GL info: AMD Radeon Graphics GL version 4.6.0 Core Profile Context 24.10.21.03.240627, ATI Technologies Inc. [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "[1.20.1] SecurityCraft v1.10.0.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "ad_astra-forge-1.20.1-1.15.20.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "architectury-9.2.14-forge.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "bellsandwhistles-0.4.5-1.20.x-Create6.0+.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "botarium-forge-1.20.1-2.3.4.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "chloride-FORGE-mc1.20.1-v1.7.2.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "copycats-3.0.1+mc.1.20.1-forge.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "Create Encased-1.20.1-1.7.1-fix2.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "create-1.20.1-6.0.4.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "create_enchantment_industry-1.3.2-for-create-6.0.4.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.713] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "create_security-0.1.2-forge-1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.714] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "createdeco-2.0.3-1.20.1-forge.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.714] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "createframed-1.20.1-1.6.5.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.714] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "creategoggles-1.20.1-6.0.0-[FORGE].jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "Crystal-Clear-2.1-Beta-forge.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "design_decor-0.4.0b-1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "embeddium-0.3.31+mc1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "entityculling-forge-1.7.4-mc1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "interiors-0.5.6+forge-mc1.20.1-local.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "Jade-1.20.1-Forge-11.13.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "jei-1.20.1-forge-15.20.0.112.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "ManyIdeasCore-1.20.1-1.4.2.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "ManyIdeasDoors-1.20.1-1.2.3.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "prma-1.20.1-0.4.4-cr6.0-SIMPLE-beta-all.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.715] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "RecipesLibrary-1.20.1-2.0.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "resourcefulconfig-forge-1.20.1-2.1.3.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "resourcefullib-forge-1.20.1-2.1.29.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "rubidium-extra-0.5.4.4+mc1.20.1-build.131.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "rubidium-mc1.20.1-0.7.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "skinlayers3d-forge-1.7.5-mc1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "Steam_Rails-1.6.7+forge-mc1.20.1.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "tacz-1.20.1-1.1.5.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "Xaeros_Minimap_25.2.6_Forge_1.20.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.716] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "XaerosWorldMap_1.39.9_Forge_1.20.jar" of type MOD with provider {mods folder locator at C:\Users\sammi\AppData\Roaming\PrismLauncher\instances\SITE 111\minecraft\mods} [06Jun2025 16:18:49.853] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\sammi\AppData\Roaming\PrismLauncher\libraries\net\neoforged\fancymodloader\core\47.2.2\core-47.2.2.jar is missing mods.toml file [06Jun2025 16:18:49.856] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\sammi\AppData\Roaming\PrismLauncher\libraries\net\neoforged\fancymodloader\language-java\47.2.2\language-java-47.2.2.jar is missing mods.toml file [06Jun2025 16:18:49.858] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\sammi\AppData\Roaming\PrismLauncher\libraries\net\neoforged\fancymodloader\language-lowcode\47.2.2\language-lowcode-47.2.2.jar is missing mods.toml file [06Jun2025 16:18:49.861] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file C:\Users\sammi\AppData\Roaming\PrismLauncher\libraries\net\neoforged\fancymodloader\language-minecraft\47.2.2\language-minecraft-47.2.2.jar is missing mods.toml file [06Jun2025 16:18:49.866] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "core-47.2.2.jar" of type LIBRARY with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.867] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-java-47.2.2.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.867] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-lowcode-47.2.2.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.867] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "language-minecraft-47.2.2.jar" of type LANGPROVIDER with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.867] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "client-1.20.1-20230612.114412-srg.jar" of type MOD with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.867] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "forge-1.20.1-47.1.105-universal.jar" of type MOD with provider net.minecraftforge.fml.loading.moddiscovery.MinecraftLocator@3c2fa57a [06Jun2025 16:18:49.872] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Found mod file "events-47.2.2.jar" of type GAMELIBRARY with provider net.minecraftforge.fml.loading.moddiscovery.BuiltinGameLibraryLocator@38834000 [06Jun2025 16:18:49.881] [main/ERROR] [net.minecraftforge.fml.loading.UniqueModListBuilder/LOADING]: Found duplicate mods:     Mod ID: 'rubidium' from mod files: rubidium-mc1.20.1-0.7.1.jar, embeddium-0.3.31+mc1.20.1.jar [06Jun2025 16:18:49.882] [main/ERROR] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Failed to build unique mod list after mod discovery. net.minecraftforge.fml.loading.EarlyLoadingException: Duplicate mods found     at net.minecraftforge.fml.loading.UniqueModListBuilder.buildUniqueList(UniqueModListBuilder.java:87) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:106) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.FMLLoader.beginModScan(FMLLoader.java:164) ~[loader-47.2.2.jar:47.2]     at net.minecraftforge.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:86) ~[loader-47.2.2.jar:47.2]     at cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100) ~[modlauncher-10.0.9.jar:?]     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]     at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779) ~[?:?]     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[?:?]     at java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[?:?]     at java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[?:?]     at java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[?:?]     at cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.Launcher.run(Launcher.java:88) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?]     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]     at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:67) ~[?:?]     at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:105) ~[?:?]     at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129) ~[?:?]     at org.prismlauncher.EntryPoint.main(EntryPoint.java:70) ~[?:?] [06Jun2025 16:18:49.894] [main/ERROR] [net.minecraftforge.fml.loading.moddiscovery.ModDiscoverer/SCAN]: Mod Discovery failed. Skipping dependency discovery.    
    • I've just started modding, and I'm trying to make custom swords. When I try to import SwordItem, I get the error:  What confuses me is that other item classes work fine: package io.github.xxx.denseswords.item; import io.github.xxx.denseswords.DenseSwords; import net.minecraft.world.item.Item; // works fine import net.minecraft.world.item.ShovelItem; // works fine import net.minecraft.world.item.SwordItem; // Error: The import cannot be resolved import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.RegistryObject; Forge MDK v55.0.15 - Minecraft 1.21.5 Java v24.0.1 Windows 11 IDE: Visual Studio Code
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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