"Breaking" blocks like a player does?

Discussion in 'Plugin Development' started by ryanhamshire, Jan 9, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    ryanhamshire

    I'm breaking leaf blocks, and I'd like to let Minecraft figure out whether or not a sapling should drop, and which type of sapling. Is there a way I can break a block programmatically the same way a player would?
    I know I can simply set the block material to air, but that won't take care of the random chance for saplings and sapling type.
     
  2. Offline

    ryanhamshire

    Yeah, I don't see this as maintainable. If vanilla changes the way it decides whether or not to drop a seed or apple or whatever, then I have to go and duplicate that code. That's why I was interested in asking Minecraft to do it for me, rather than coding some custom solution that approximates my guess at how Minecraft does it.

    Thanks, though! I just decided not to break the leaves, and instead let them decay on their own.
     
  3. Offline

    Njol

    Bone008 likes this.
Thread Status:
Not open for further replies.

Share This Page