Plant events

Started by LueLusten on Wed, 11/30/2016 - 13:44

Topic category: Help with MCreator's application

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Plant events
Wed, 11/30/2016 - 13:46 (edited)

Why is there no plaint item events at all? I need to change add a random event to add seeds when a crap is havist 

if ((Math.random() * 100) <= 20) {
        if (entity instanceof EntityPlayer)
               ((EntityPlayer) entity).inventory.addItemStackToInventory(new ItemStack(mcreator_soulSeeds.block, 1));
 }

But there is no place to put it no events or anything and I tried adding it to the item code but clearly that was wrong
        @Override
        public Item getItemDropped(IBlockState state, Random rand, int fortune) {
            return new ItemStack(mcreator_babySouls.block).getItem();
        }

@Override
        public Item getItemDropped(IBlockState state, Random rand, int fortune) {      if ((Math.random() * 100) <= 20) {
                    if (entity instanceof EntityPlayer)
                         ((EntityPlayer) entity).inventory.addItemStackToInventory(new ItemStack(mcreator_soulSeeds.block, 1));
               }

            return new ItemStack(mcreator_babySouls.block).getItem();
 }       

 

Not getting any errors but it does not drop the seeds at all

Also there is a strange bug with the Univrisal locations of crops and plants, they spawned all over and in the sky ...

Edited by LueLusten on Wed, 11/30/2016 - 13:46
Last seen on 13:38, 21. Aug 2018
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Weird.
Wed, 11/30/2016 - 14:33

Weird.

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Yes I know its werid but that
Wed, 11/30/2016 - 14:36

Yes I know its werid but that is not helpful and pushs a reply,please reply helpfully, ideas on how to fix it or ideas where the code should go.

One word replies tho give me fauls hope that someone can help me, hope you understand.

Last seen on 16:39, 18. May 2019
Joined Dec 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I have the same problem with
Wed, 11/30/2016 - 21:18

I have the same problem with plants spawning everywhere. i am going to mess around with them and see if I can change that, because I need to add in some into my mod.

Last seen on 13:38, 21. Aug 2018
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Yes I know its werid but that
Thu, 12/01/2016 - 00:12

@#2 Sry. I think a soulution would be to make the drop rate anything except 1. (That happens with mob spawn rates, so...)