본문으로 건너뛰기
버전: Minecraft 26.2

dev.polymodloader.api.event.block

자동 생성

이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.

형식종류설명
BlockBreakListener함수형 인터페이스Listener for BlockEvents.BREAK.
BlockBrokenListener함수형 인터페이스Listener for BlockEvents.BROKEN.
BlockEvents클래스Block events, fired on the server thread.
BlockPlaceListener함수형 인터페이스Listener for BlockEvents.PLACE.
BlockPlacedListener함수형 인터페이스Listener for BlockEvents.PLACED.

BlockBreakListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface BlockBreakListener

Listener for BlockEvents.BREAK.

onBlockBreak(WorldView, BlockPos, ResourceId, PlayerView)​

EventResult onBlockBreak(WorldView world, BlockPos pos, ResourceId block, PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread before the block is removed. The views are valid only during the call.

인자타입설명
worldWorldViewthe world the block is in
posBlockPoswhere it is
blockResourceIdthe block about to be broken
playerPlayerViewwho breaks it

반환 EventResult — DENY to keep the block (the player's client is told the block is still there); PASS or ALLOW to let the game break it

BlockBrokenListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface BlockBrokenListener

Listener for BlockEvents.BROKEN.

onBlockBroken(WorldView, BlockPos, ResourceId, PlayerView)​

void onBlockBroken(WorldView world, BlockPos pos, ResourceId block, PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread after the block was removed and its drops spawned.

인자타입설명
worldWorldViewthe world the block was in
posBlockPoswhere it was
blockResourceIdthe block that was broken
playerPlayerViewwho broke it

BlockEvents​

클래스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public final class BlockEvents

Block events, fired on the server thread.

상수·필드타입설명
BREAKEventKey<BlockBreakListener>A player is about to break a block (survival or creative); a decision event (see EventResult): DENY keeps the block. Fired before the game's own checks for the held item, game master blocks, and adventure mode, so it also fires for breaks the game then refuses. Fabric API: PlayerBlockBreakEvents.BEFORE; NeoForge: BlockEvent.BreakEvent.
BROKENEventKey<BlockBrokenListener>A player broke a block (survival or creative).
PLACEEventKey<BlockPlaceListener>A player is about to place a block from a block item (including beds and doors); a decision event: DENY refuses it. NeoForge: BlockEvent.EntityPlaceEvent for players.
PLACEDEventKey<BlockPlacedListener>A player placed a block from a block item.

BlockPlaceListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface BlockPlaceListener

Listener for BlockEvents.PLACE.

onBlockPlace(WorldView, BlockPos, ResourceId, PlayerView)​

EventResult onBlockPlace(WorldView world, BlockPos pos, ResourceId block, PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread after the game checked that the block fits, before it is set. The views are valid only during the call.

인자타입설명
worldWorldViewthe world
posBlockPoswhere the block goes
blockResourceIdthe block about to be placed
playerPlayerViewwho places it

반환 EventResult — DENY to refuse the placement (the item is not used up and the player's client is resynchronised); PASS or ALLOW to let it happen

BlockPlacedListener​

함수형 인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전

public interface BlockPlacedListener

Listener for BlockEvents.PLACED.

onBlockPlaced(WorldView, BlockPos, ResourceId, PlayerView)​

void onBlockPlaced(WorldView world, BlockPos pos, ResourceId block, PlayerView player)

추가된 버전 0.1.0-alpha.4 또는 그 이전

Called on the server thread after the block was placed, its block entity data applied, and the item used up. The views are valid only during the call.

인자타입설명
worldWorldViewthe world
posBlockPoswhere the block is
blockResourceIdthe placed block
playerPlayerViewwho placed it
Buy me a coffee