Skip to content

Anyone know how to make like pebbles? #714

Discussion options

You must be logged in to vote
BlockEvents.rightClicked('somemod:some_block', event => {
  // pop an item into the world
  event.block.popItemFromFace('minecraft:egg', event.facing)
  // or you can give it directly to the player
  event.player.give('egg')
  // or even have a percent chance to drop it/another one (this is 25%)
  if (Math.random() < 0.25) 
    event.block.popItemFromFace('egg', event.facing)

  // you can also change the block
  event.block.set('minecraft:hay_bale')
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KingTino104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants