File tree 3 files changed +11
-8
lines changed
3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -396,12 +396,14 @@ Note: The player may trigger this event on the server multiple times in a row.
396
396
#### ` "onPlaceBlock" ` - Player Try Places Block Event
397
397
398
398
- Listener function prototype
399
- ` function(player,block) `
399
+ ` function(player,block,face ) `
400
400
- Parameters:
401
401
- player : ` Player `
402
402
The player that placed the block.
403
403
- block : ` Block `
404
- The block that was placed.
404
+ The block that was placed on.
405
+ - face : ` Integer `
406
+ The face that was placed on.
405
407
406
408
- Intercept events: function returns ` false `
407
409
Original file line number Diff line number Diff line change 407
407
#### ` "onPlaceBlock" ` - 玩家尝试放置方块
408
408
409
409
- 监听函数原型
410
- ` function(player,block) `
410
+ ` function(player,block,face ) `
411
411
- 参数:
412
412
- player : ` Player `
413
413
放置方块的玩家对象
414
414
415
415
- block : ` Block `
416
416
将要放置的方块对象
417
417
418
+ - face : ` Integer `
419
+ 被放置的方块的朝向。
420
+
418
421
- 拦截事件:函数返回` false `
419
422
420
- > ** 存在问题**
421
- >
422
- > 1 . 当玩家尝试放置方块时,该事件将持续被触发。
423
- > 2 . 方块对象为准星对准的方块,并非将放置方块对象。
423
+ > ** 存在问题** 当玩家尝试放置方块时,该事件将持续被触发。
424
424
425
425
426
426
Original file line number Diff line number Diff line change @@ -276,7 +276,8 @@ void EnableEventListener(int eventId) {
276
276
CallEvent (
277
277
EVENT_TYPES::onPlaceBlock,
278
278
PlayerClass::newPlayer (&ev.self ()),
279
- BlockClass::newBlock (ev.pos (), ev.self ().getDimensionId ())
279
+ BlockClass::newBlock (truePos, ev.self ().getDimensionId ()),
280
+ Number::newNumber ((schar)ev.face ())
280
281
);
281
282
}
282
283
IF_LISTENED_END (EVENT_TYPES::onPlaceBlock);
You can’t perform that action at this time.
0 commit comments