Translations:Modding:Advanced Blocks/19/en

From Vintage Story Wiki
Revision as of 00:04, 12 November 2023 by FuzzyBot (talk | contribs) (Importing a new version from external source)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The method void onEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, bool isImpact) seems to be a good way to implement a bouncy functionality. Note that every trampoline block placed in the game will share the same instance of TrampolineBlock. Because that object is shared by multiple blocks, it does not have a field for the block position. That's why the event handler includes the pos parameter.