Translations:Modding:Advanced Blocks/19/en

From Vintage Story Wiki
Revision as of 13:39, 25 March 2024 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, Vec3d collideSpeed, 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.