Jump to content

[1.8.9][SOLVED] Throwable Item wont spawn?


terraya

Recommended Posts

Hello Dear Forum,

 

my "EntityCreator" wont work ... it looks like, theres a problem with registering the Spawn egg ...

 

GOT ANOTHER PROBLEM; PLEASE READ BELOW POST

 

--- ERROR LOG---

---- Minecraft Crash Report ----
// My bad.

Time: 13.10.16 16:53
Description: Initializing game

java.lang.IllegalArgumentException: Entity not registered in classToString map: class ArturFarid.BlockUpdate.entity.EntityModelTest
at net.minecraftforge.fml.common.registry.EntityRegistry.registerEgg(EntityRegistry.java:221)
at ArturFarid.BlockUpdate.init.EntityCreator.generateSpawnEgg(EntityCreator.java:27)
at ArturFarid.BlockUpdate.BlocksUpdate.Init(BlocksUpdate.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:737)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:310)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:532)
at net.minecraft.client.Minecraft.run(Minecraft.java:360)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)

 

--- ENTITYCREATOR---

public class EntityCreator {

public static void registerEntities() {
	registerEntity(EntityModelTest.class, "EntityModelTest", 64, 20, true);
}

public static void setEntityToSpawn() {
	EntityRegistry.addSpawn(EntityModelTest.class, 5, 1, 10, EnumCreatureType.MONSTER, BiomeGenBase.beach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.extremeHillsPlus, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.hell, BiomeGenBase.jungle, BiomeGenBase.plains);
}

public static void generateSpawnEgg() {
	EntityRegistry.registerEgg(EntityModelTest.class, 0, 0);
}

private static int entityID = 0;

/**
 * Register an entity with the specified tracking values.
 *
 * @param entityClass          The entity's class
 * @param entityName           The entity's unique name
 * @param trackingRange        The range at which MC will send tracking updates
 * @param updateFrequency      The frequency of tracking updates
 * @param sendsVelocityUpdates Whether to send velocity information packets as well
 */
private static void registerEntity(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) {
	EntityRegistry.registerModEntity(entityClass, entityName, entityID++, BlocksUpdate.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
}

}

 

--- MY TEST MODEL ---

public class ModelTest extends ModelBase
{
  //fields
    ModelRenderer leg2;
    ModelRenderer leg1;
    ModelRenderer body;
    ModelRenderer head;
  
  public ModelTest()
  {
    textureWidth = 64;
    textureHeight = 32;
    
      leg2 = new ModelRenderer(this, 10, 14);
      leg2.addBox(-1F, 0F, -3F, 3, 15, 3);
      leg2.setRotationPoint(4F, 9F, 1F);
      leg2.setTextureSize(64, 32);
      leg2.mirror = true;
      setRotation(leg2, 0F, 0F, 0F);
      leg1 = new ModelRenderer(this, 52, 10);
      leg1.addBox(-2F, 0F, -3F, 3, 15, 3);
      leg1.setRotationPoint(-5F, 9F, 1F);
      leg1.setTextureSize(64, 32);
      leg1.mirror = true;
      setRotation(leg1, 0F, 0F, 0F);
      body = new ModelRenderer(this, 0, 0);
      body.addBox(0F, 0F, 0F, 17, 20, ;
      body.setRotationPoint(-9F, -11F, -5F);
      body.setTextureSize(64, 32);
      body.mirror = true;
      setRotation(body, 0F, 0F, 0F);
      head = new ModelRenderer(this, 41, 0);
      head.addBox(-4F, -5F, -2F, 8, 5, 4);
      head.setRotationPoint(-1F, -11F, -2F);
      head.setTextureSize(64, 32);
      head.mirror = true;
      setRotation(head, 0F, 0F, 0F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    leg2.render(f5);
    leg1.render(f5);
    body.render(f5);
    head.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    this.leg1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
    this.leg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
    this.leg1.rotateAngleY = 0.0F;
    this.leg2.rotateAngleY = 0.0F;
  }

}

 

--- MY CLIENTPROXY ---

 

public class ClientProxy
  extends CommonProxy
{
  public void registeRenders()
  {
    BlocksUpdate.registerRenders();
    ItemsUpdate.registerRenders();
  }
  
  public void registerEntityRenders() {
	RenderingRegistry.registerEntityRenderingHandler(EntityModelTest.class, new RenderModelTest()); //use depricated method
  }
}

 

--- MY RENDER MODEL ---

public class RenderModelTest extends RenderLiving{

public RenderModelTest() {
	super(Minecraft.getMinecraft().getRenderManager(), new ModelTest(), 0);

}

@Override
protected ResourceLocation getEntityTexture(Entity entity) {
	return new ResourceLocation("blockupdate", "textures/entity/ModelTest.png");
}

}

 

--- MY MAIN CLASS ---

 

@Mod(modid = "BlockUpdate", name="BlockUpdate Mod", version="2.1", acceptedMinecraftVersions="[1.8.9]")
public class BlocksUpdate
{

  @SidedProxy(clientSide="ArturFarid.BlockUpdate.proxy.ClientProxy", serverSide="ArturFarid.BlockUpdate.proxy.CommonProxy")
  public static CommonProxy proxy;
  
public static Item_Tab item_tab = new Item_Tab();
public static Sword_Tab sword_tab = new Sword_Tab();
public static Food_Tab food_tab = new Food_Tab();
public static Devil_Fruit_Tab devil_fruit_tab = new Devil_Fruit_Tab();

@Instance  
public static BlocksUpdate instance;
  
  @EventHandler
  public void preInit(FMLPreInitializationEvent event)
  {
ArturFarid.BlockUpdate.init.BlocksUpdate.init();
ArturFarid.BlockUpdate.init.BlocksUpdate.register();
    ItemsUpdate.init();
    ItemsUpdate.register();
  }
  
  @EventHandler
  public void Init(FMLInitializationEvent event)
  {
  EntityCreator.generateSpawnEgg();
  EntityCreator.registerEntities();
  EntityCreator.setEntityToSpawn();
  }
  
  @EventHandler
  public void postInit(FMLPostInitializationEvent event) {}
}

Link to comment
Share on other sites

EntityRegistry.registerEgg

must be called after

EntityRegistry.registerModEntity

. Alternatively, call the

EntityRegistry.registerModEntity

overload with the two additional

int

arguments and it will register the spawn egg for you.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

i got another problem with a "throwable Entity" , my normal one will spawn but that one doesnt ,

 

ofc its throwable but i cannot find a fix for this, i was learning by a tutorial but it end before the whole thing work ...

 

 

thats the entitymodel.class:

 

public class IceBall extends EntityThrowable
{
  public IceBall(World par1World)
  {
    super(par1World);
  }
  
  public IceBall(World par1World, EntityPlayer par3EntityPlayer)
  {
    super(par1World, par3EntityPlayer);
  }
  
  public IceBall(World par1World, double par2, double par4, double par6)
  {
    super(par1World, par2, par4, par6);
  }
  
  public int ticks = 20;
  
  public void onEntityUpdate()
  {
    if (this.ticks <= 0)
    {
      this.ticks = 20;
      setDead();
    }
    else
    {
      this.ticks -= 1;
    }
  }
  
  protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
  {
    if (par1MovingObjectPosition.entityHit != null)
    {
      double x = 0.0D;
      double y = 0.0D;
      double z = 0.0D;
      
      EntityLivingBase living = (EntityLivingBase)par1MovingObjectPosition.entityHit;
      
      living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 300, 3000));
      
      x = par1MovingObjectPosition.entityHit.posX;
      y = par1MovingObjectPosition.entityHit.posY;
      z = par1MovingObjectPosition.entityHit.posZ;
      
      worldObj.setBlockState(new BlockPos(x , y + 2, z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y , z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y , z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x , y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y , z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x , y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y , z - 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y , z + 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y , z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 1, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y , z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y , z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y , z + 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y , z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 1, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y , z - 2), Blocks.packed_ice.getDefaultState());
   
      worldObj.setBlockState(new BlockPos(x + 1, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y , z - 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y , z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y , z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z- 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y , z - 2), Blocks.packed_ice.getDefaultState());

      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z -2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y , z - 2), Blocks.packed_ice.getDefaultState());

      par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 5.0F);
    }
    if (!this.worldObj.isRemote)
    {
      int x = par1MovingObjectPosition.getBlockPos().getX();
      int y = par1MovingObjectPosition.getBlockPos().getY();
      int z = par1MovingObjectPosition.getBlockPos().getZ();
      
      worldObj.setBlockState(new BlockPos(x , y + 2, z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y + 2, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y, z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y, z), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x , y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y, z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x , y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x , y, z - 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y, z + 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 1, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y, z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y, z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z + 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y, z + 1), Blocks.packed_ice.getDefaultState());

      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z - 1), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y, z - 1), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 1, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 1, y, z - 2), Blocks.packed_ice.getDefaultState());    
      
      worldObj.setBlockState(new BlockPos(x + 1, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 1, y, z - 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y, z + 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z + 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y, z + 2), Blocks.packed_ice.getDefaultState());
    
      worldObj.setBlockState(new BlockPos(x + 2, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x + 2, y, z - 2), Blocks.packed_ice.getDefaultState());
      
      worldObj.setBlockState(new BlockPos(x - 2, y + 1, z - 2), Blocks.packed_ice.getDefaultState());
      worldObj.setBlockState(new BlockPos(x - 2, y, z - 2), Blocks.packed_ice.getDefaultState());
      
      setDead();
    }
  }
}

 

THATS THE MODEL

 

public class ModelBall
  extends ModelBase
{
  ModelRenderer Shape1;
  ModelRenderer Shape2;
  ModelRenderer Shape3;
  ModelRenderer Shape4;
  ModelRenderer Shape5;
  ModelRenderer Shape6;
  ModelRenderer Shape7;
  
  public ModelBall()
  {
    this.textureWidth = 64;
    this.textureHeight = 64;
    
    this.Shape1 = new ModelRenderer(this, 0, 0);
    this.Shape1.addBox(0.0F, 0.0F, 0.0F, 4, 4, 4);
    this.Shape1.setRotationPoint(-1.0F, 0.0F, -3.0F);
    this.Shape1.setTextureSize(64, 64);
    this.Shape1.mirror = true;
    setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
    this.Shape2 = new ModelRenderer(this, 0, 0);
    this.Shape2.addBox(0.0F, 0.0F, 0.0F, 3, 1, 3);
    this.Shape2.setRotationPoint(-0.5F, -0.7F, -2.5F);
    this.Shape2.setTextureSize(64, 64);
    this.Shape2.mirror = true;
    setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
    this.Shape3 = new ModelRenderer(this, 0, 0);
    this.Shape3.addBox(0.0F, 0.0F, 0.0F, 3, 1, 3);
    this.Shape3.setRotationPoint(-0.5F, 3.7F, -2.5F);
    this.Shape3.setTextureSize(64, 64);
    this.Shape3.mirror = true;
    setRotation(this.Shape3, 0.0F, 0.0F, 0.0F);
    this.Shape4 = new ModelRenderer(this, 0, 0);
    this.Shape4.addBox(0.0F, 0.0F, 0.0F, 1, 3, 3);
    this.Shape4.setRotationPoint(-1.7F, 0.5F, -2.5F);
    this.Shape4.setTextureSize(64, 64);
    this.Shape4.mirror = true;
    setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
    this.Shape5 = new ModelRenderer(this, 0, 0);
    this.Shape5.addBox(0.0F, 0.0F, 0.0F, 1, 3, 3);
    this.Shape5.setRotationPoint(2.7F, 0.5F, -2.5F);
    this.Shape5.setTextureSize(64, 64);
    this.Shape5.mirror = true;
    setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
    this.Shape6 = new ModelRenderer(this, 0, 0);
    this.Shape6.addBox(0.0F, 0.0F, 0.0F, 3, 3, 1);
    this.Shape6.setRotationPoint(-0.5F, 0.5F, 0.7F);
    this.Shape6.setTextureSize(64, 64);
    this.Shape6.mirror = true;
    setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
    this.Shape7 = new ModelRenderer(this, 0, 0);
    this.Shape7.addBox(0.0F, 0.0F, 0.0F, 3, 3, 1);
    this.Shape7.setRotationPoint(-0.5F, 0.5F, -3.7F);
    this.Shape7.setTextureSize(64, 64);
    this.Shape7.mirror = true;
    setRotation(this.Shape7, 0.0F, 0.0F, 0.0F);
  }
  
  public void func_78088_a(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5);
    this.Shape1.render(f5);
    this.Shape2.render(f5);
    this.Shape3.render(f5);
    this.Shape4.render(f5);
    this.Shape5.render(f5);
    this.Shape6.render(f5);
    this.Shape7.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
  }
}

 

 

the spawnegg etc is there but when i want to spawn it, it wont appear ... and when i want to "addspawn" it wont let me ..(ofc bcuz its a throwable item)

Link to comment
Share on other sites

It looks like you haven't registered the

IceBall

class with

EntityRegistry.registerModEntity

.

 

Side note: Always annotate override methods with

@Override

so you get a compilation error if they don't actually override a super method.

 

In future, please leave the original question in tact and ask new questions in separate replies or threads.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

It looks like you haven't registered the

IceBall

class with

EntityRegistry.registerModEntity

.

 

Side note: Always annotate override methods with

@Override

so you get a compilation error if they don't actually override a super method.

 

In future, please leave the original question in tact and ask new questions in separate replies or threads.

 

alright, sorry thought that if i open a new theard it will be annoying ..

 

well i actualy registered it :/

 

		EntityRegistry.registerModEntity(IceBall.class, "IceBall", 0, BlocksUpdate.instance, 64, 20, true);
	EntityRegistry.registerEgg(IceBall.class, 0xFF00, 0xFF00);

 

i click rightclick on the ground and it dont work,

(for an throwable Entity/Item) shouldnt i be able to rightclick on the air or anywhere else to even spawn it, i mean, it goes straight until it hits anything and then a iceblock appear .. :S

Link to comment
Share on other sites

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

    • im stuck in a problem whit BlockEntities i cannot solve so im trying to work around it but in the less complex way possible  i think is posible to store data to the minecraft world  in older versions people talk about  WordDataSave i dont find anything about it for 1.20.4  i find a tutorial for player capability in 1.19    here is an event      //########## ########## ########## ##########     @SubscribeEvent     public static void onAttachCapabilitiesPlayer(AttachCapabilitiesEvent<Entity> event) {         if(event.getObject() instanceof Player) {             if(!event.getObject().getCapability(PlayerThirstProvider.PLAYER_THIRST).isPresent()) {                 event.addCapability(new ResourceLocation(mercmod.MOD_ID, "properties"), new PlayerThirstProvider());             }         }     }  soo i made this      //########## ########## ########## ##########     @SubscribeEvent     public static void onAttachCapabilitiesLevel(AttachCapabilitiesEvent<Level> event) {     } i think i can do some witchcraft  here  but is many things don't understand  to start whit i dont get yet how to recall the saved data from a BlockEntity  the handler still in progress the plan is to make a Map to store nbt data using the block coordinates as index later store that map as a big nbt      ########## any way the question is if theres alredy a tutorial for 1.20.4 for this ?? or some alredy working code from someone else doing something similar ?           
    • I tried this, and found out that Oculus is the mod that is crashing the game. I have removed it, and it now works fine! Thanks!
    • Hi @DanielderErbauer, I arrived here as I have the "as it does not exist in Block{minecraft:air}" error in a modpack I am trying to start. It's a long-shot, I know, but as the post that led this to being solved is missing, can I ask if you may recall what it said? Thanks in advance
    • Hm yeah sorry, not seeing anything else that's sticking out, I'd need to debug myself probably. Do you have a github or bitbucket repo? I could poke around when I have time to see what the problem might be.
    • looking around for the capabilities thing i found a piece of code and find this piece of code  //########## ########## ########## ########## @SubscribeEvent public static void addCustomTrades(VillagerTradesEvent event) { if(event.getType() == VillagerProfession.FLETCHER) { System.out.println("\n\n### VillagerProfession.FLETCHER \n\n");//<----------- Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades(); ItemStack stack = new ItemStack(ItemInit.ARROW_STEEL.get(), 16); int villagerLevel = 1; trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( new ItemStack(Items.EMERALD, 2), stack,1,3,0.02F)); } if(event.getType() == VillagerProfession.TOOLSMITH) { System.out.println("\n\n### VillagerProfession.TOOLSMITH \n\n");//<----------- Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades(); ItemStack stack = new ItemStack(ItemInit.INGOT_STEEL.get(), 1); int villagerLevel = 1; trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( new ItemStack(Items.EMERALD, 2), stack,10,8,0.02F)); } } //########## ########## ########## ########## the event is aknoledge and execute when the maps load  ### VillagerProfession.FLETCHER  ### VillagerProfession.TOOLSMITH  //########## But is not working      is a random piece of code is not working  could it be than this code is old 1.18 and no valid anymore for 1.20.4 or the thing are this numbers  stack,10,8,0.02F));  i dont know what this numbers means    ########## the question is ¿how to add things to the villager traders    thanks for your attention               
  • Topics

×
×
  • Create New...

Important Information

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