Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #priority 500
- import crafttweaker.entity.IEntityLivingBase;
- import crafttweaker.player.IPlayer;
- import crafttweaker.world.IRayTraceResult;
- import crafttweaker.entity.IEntity;
- import crafttweaker.event.PlayerTickEvent;
- function checkEntity(playerRay as IRayTraceResult) {
- if (playerRay.isMiss) == true {
- print("Is Miss");
- }
- if (playerRay.isBlock) == true {
- print("Is Block");
- }
- if (playerRay.isEntity) == true {
- print("Is Entity");
- }
- if !(isNull(playerRay.entity)) {
- print("Entity Found");
- }
- }
- events.onPlayerTick(function (event as PlayerTickEvent) {
- if (event.phase == "START") {
- val player as IEntityLivingBase = event.player;
- val playerRay as IRayTraceResult = player.getRayTrace(20.0, 10);
- if !(isNull(playerRay)) {
- checkEntity(playerRay);
- }
- }
- });
Add Comment
Please, Sign In to add comment