Interface BlockEvents.Place

Record Components:
state - the block it would place
placer - who places it, or null for a dispenser or another machine
stack - the item placing it, or ItemStack.EMPTY for an enderman
Enclosing class:
BlockEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface BlockEvents.Place
A block is about to be placed, on the server; interrupting stops it, and the item isn't used up. Fired for block items, whoever uses them (players, dispensers, other mods' machines), and for endermen setting down the block they carry. BlockEvents.PLACED follows once it is in the level.
  • Method Summary

    Modifier and Type
    Method
    Description
    onPlace(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable net.minecraft.world.entity.Entity placer, net.minecraft.world.item.ItemStack stack)
     
  • Method Details

    • onPlace

      EventResult onPlace(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, @Nullable @Nullable net.minecraft.world.entity.Entity placer, net.minecraft.world.item.ItemStack stack)