Jump to content

NBT Itemstack for entity drop


7804364

Recommended Posts

i have this currently:

    @SubscribeEvent(priority= EventPriority.NORMAL, receiveCanceled=true)

    public void onEvent(LivingDropsEvent event) {

        random = new Random();

        dropped = random.nextInt(2) + 1;

        if (event.entity instanceof EntityZombie) {

            zombieItem = random.nextInt(1);

            event.drops.clear();

            switch (zombieItem) {

                case 0:

                    ItemStack itemStoneSword = new ItemStack(Items.stone_sword, dropped);

                    itemStoneSword.getAttributeModifiers();

                    event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX,event.entity.posY, event.entity.posZ, itemStoneSword));

                    break;

                case 1:

                    ItemStack itemIronSword = new ItemStack(Items.iron_sword, dropped);

                    itemIronSword.getAttributeModifiers();

                    event.drops.add(new EntityItem(event.entity.worldObj, event.entity.posX,event.entity.posY, event.entity.posZ, itemIronSword));

                    break;

            }

        }

    }

 

But what i want to do is for the items that drop liek the stone_sword, i want it to have a random damage, and some things added in description that is different from other items.

Link to comment
Share on other sites

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.