Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

  • Author

i mean i kinda dont get what you mean right now, what should i do?

Edited by TeeAgeSee

  • Author

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

  • Author

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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.