Created
June 4, 2020 12:40
-
-
Save StarCheater/7d1e568b42bb2c84d99f26fcac18e765 to your computer and use it in GitHub Desktop.
Example with no work teleport entity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace VSExampleMods | |
{ | |
public class TrampolineMod : ModSystem | |
{ | |
public override void Start(ICoreAPI api) | |
{ | |
base.Start(api); | |
api.RegisterBlockClass("trampoline", typeof(TrampolineBlock)); | |
} | |
} | |
public class TrampolineBlock : Block | |
{ | |
public override void OnEntityCollide(IWorldAccessor world, Entity entity, BlockPos pos, BlockFacing facing, | |
Vec3d collideSpeed, bool isImpact) | |
{ | |
entity.TeleportTo(entity.Pos.AsBlockPos.UpCopy().ToVec3d().Add(0.5, 0.5, 0.5)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment