Jump to content

Recommended Posts

Posted

Hey everyone, so i need help on making the entity drop an item,

first of all i made an entity called AlphaSkeleton, now i want it to drop an item with the amount that i choose.

I tried a lots of things, like:

public EntityItem entityDropItem(ItemStack p_70099_1_, float p_70099_2_)
        {
                EntityItem entityitem = new EntityItem(this.worldObj, this.posX, this.posY + (double)p_70099_2_, this.posZ, new ItemStack(ModItems.alpha_nugget));
                entityitem.delayBeforeCanPickup = 10;
                if (captureDrops)
                {
                    capturedDrops.add(entityitem);
                }
                else
                {
                    this.worldObj.spawnEntityInWorld(entityitem);
                }
                return entityitem;
           }

 

but on that i cant choose the amount,

 

also that one: 

 

protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
        {
            int j;
            int k;

            if (this.getSkeletonType() == 1)
            {
                j = this.rand.nextInt(3 + p_70628_2_) - 1;

                for (k = 0; k < j; ++k)
                {
                    this.dropItem(Items.coal, 2);
                }
            }
            else
            {
                j = this.rand.nextInt(3 + p_70628_2_);

                for (k = 0; k < j; ++k)
                {
                    this.dropItem(Items.arrow, 1);
                }
            }

            j = this.rand.nextInt(3 + p_70628_2_);

            for (k = 0; k < j; ++k)
            {
                this.dropItem(Items.bone, 1);
            }
            
            j = this.rand.nextInt(3 + p_70628_2_);

            for (k = 0; k < j; ++k)
            {
                this.dropItem(ModItems.alpha_nugget, 1);
            }
        }

 

here the problem is that he doesnt always drop that things...

can anyone help me?

 

Thanks in advance and i apolgize for my english im a bit in stress right now

Posted

Well i already searched in EntitySkeleton for Loot but i didnt find anything, maybe its because im coding on 1.7.10.

I really dont want to change to newer versions because me and all my friends play on 1.7.10 modpacks so yea

Posted

nvm i think 

protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
        {
            int j;
            int k;
            j = this.rand.nextInt(3 + p_70628_2_);

            for (k = 0; k < j; ++k)
            {
                this.dropItem(ModItems.alpha_nugget, 2);
            }
        }

is totally good enough for me, thanks for your help anyways tho ^^

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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