Jump to content

[1.18.2]Custom not living entity is invisible


FREyebeans2506

Recommended Posts

Ive been trying all day to get the entity to show up but it just stays invisible apart from its shadow and hit box(F3+B).

google is dumb and changes the url for the image constantly

all 6 relevant classes

Spoiler

the entity

package com.freyebeans.batoohell.entities;

import com.freyebeans.batoohell.util.ContentRegister;
import com.google.common.collect.Lists;
import net.minecraft.BlockUtil;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.entity.animal.WaterAnimal;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.DismountHelper;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.WaterlilyBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.network.NetworkHooks;

import javax.annotation.Nullable;
import java.util.List;

public class Speeder extends Entity {
    private static final EntityDataAccessor<Integer> DATA_ID_HURT = SynchedEntityData.defineId(Speeder.class, EntityDataSerializers.INT);
    private static final EntityDataAccessor<Integer> DATA_ID_HURTDIR = SynchedEntityData.defineId(Speeder.class, EntityDataSerializers.INT);
    private static final EntityDataAccessor<Float> DATA_ID_DAMAGE = SynchedEntityData.defineId(Speeder.class, EntityDataSerializers.FLOAT);
    private float invFriction;
    private float outOfControlTicks;
    private float deltaRotation;
    private int lerpSteps;
    private double lerpX;
    private double lerpY;
    private double lerpZ;
    private double lerpYRot;
    private double lerpXRot;
    private boolean inputLeft;
    private boolean inputRight;
    private boolean inputUp;
    private boolean inputDown;
    private double waterLevel;
    private float landFriction;
    private Speeder.Status status;
    private Speeder.Status oldStatus;
    private double lastYd;
    private boolean isAboveBubbleColumn;
    private boolean bubbleColumnDirectionIsDown;

    public Speeder(EntityType<? extends Speeder> entityType, Level level1) {
        super(entityType, level1);
        this.blocksBuilding = true;
    }

    public Speeder(Level p_38293_, double p_38294_, double p_38295_, double p_38296_) {
        this(ContentRegister.HELL_SPEEDER.get(), p_38293_);
        this.setPos(p_38294_, p_38295_, p_38296_);
        this.xo = p_38294_;
        this.yo = p_38295_;
        this.zo = p_38296_;
    }

    protected float getEyeHeight(Pose p_38327_, EntityDimensions p_38328_) {
        return p_38328_.height;
    }

    protected Entity.MovementEmission getMovementEmission() {
        return Entity.MovementEmission.NONE;
    }

    protected void defineSynchedData() {
        this.entityData.define(DATA_ID_HURT, 0);
        this.entityData.define(DATA_ID_HURTDIR, 1);
        this.entityData.define(DATA_ID_DAMAGE, 0.0F);
    }

    public boolean canCollideWith(Entity p_38376_) {
        return canVehicleCollide(this, p_38376_);
    }

    public static boolean canVehicleCollide(Entity p_38324_, Entity p_38325_) {
        return (p_38325_.canBeCollidedWith() || p_38325_.isPushable()) && !p_38324_.isPassengerOfSameVehicle(p_38325_);
    }

    public boolean canBeCollidedWith() {
        return true;
    }

    public boolean isPushable() {
        return true;
    }

    protected Vec3 getRelativePortalPosition(Direction.Axis p_38335_, BlockUtil.FoundRectangle p_38336_) {
        return LivingEntity.resetForwardDirectionOfRelativePortalPosition(super.getRelativePortalPosition(p_38335_, p_38336_));
    }

    public double getPassengersRidingOffset() {
        return -0.1D;
    }

    public boolean hurt(DamageSource p_38319_, float p_38320_) {
        if (this.isInvulnerableTo(p_38319_)) {
            return false;
        } else if (!this.level.isClientSide && !this.isRemoved()) {
            this.setHurtDir(-this.getHurtDir());
            this.setHurtTime(10);
            this.setDamage(this.getDamage() + p_38320_ * 10.0F);
            this.markHurt();
            this.gameEvent(GameEvent.ENTITY_DAMAGED, p_38319_.getEntity());
            boolean flag = p_38319_.getEntity() instanceof Player && ((Player)p_38319_.getEntity()).getAbilities().instabuild;
            if (flag || this.getDamage() > 40.0F) {
                if (!flag && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
                    this.spawnAtLocation(this.getDropItem());
                }

                this.discard();
            }

            return true;
        } else {
            return true;
        }
    }

    public void onAboveBubbleCol(boolean p_38381_) {
        if (!this.level.isClientSide) {
            this.isAboveBubbleColumn = true;
            this.bubbleColumnDirectionIsDown = p_38381_;
        }

        this.level.addParticle(ParticleTypes.SPLASH, this.getX() + (double)this.random.nextFloat(), this.getY() + 0.7D, this.getZ() + (double)this.random.nextFloat(), 0.0D, 0.0D, 0.0D);
        if (this.random.nextInt(20) == 0) {
            this.level.playLocalSound(this.getX(), this.getY(), this.getZ(), this.getSwimSplashSound(), this.getSoundSource(), 1.0F, 0.8F + 0.4F * this.random.nextFloat(), false);
        }

        this.gameEvent(GameEvent.SPLASH, this.getControllingPassenger());
    }

    public void push(Entity p_38373_) {
        if (p_38373_ instanceof Speeder) {
            if (p_38373_.getBoundingBox().minY < this.getBoundingBox().maxY) {
                super.push(p_38373_);
            }
        } else if (p_38373_.getBoundingBox().minY <= this.getBoundingBox().minY) {
            super.push(p_38373_);
        }

    }

    public Item getDropItem() {
        return Items.NETHERITE_BLOCK;
    }

    public void animateHurt() {
        this.setHurtDir(-this.getHurtDir());
        this.setHurtTime(10);
        this.setDamage(this.getDamage() * 11.0F);
    }

    public boolean isPickable() {
        return !this.isRemoved();
    }

    public void lerpTo(double p_38299_, double p_38300_, double p_38301_, float p_38302_, float p_38303_, int p_38304_, boolean p_38305_) {
        this.lerpX = p_38299_;
        this.lerpY = p_38300_;
        this.lerpZ = p_38301_;
        this.lerpYRot = (double)p_38302_;
        this.lerpXRot = (double)p_38303_;
        this.lerpSteps = 10;
    }

    public Direction getMotionDirection() {
        return this.getDirection().getClockWise();
    }

    public void tick() {
        this.oldStatus = this.status;
        this.status = this.getStatus();
        if (this.status != Speeder.Status.UNDER_WATER && this.status != Speeder.Status.UNDER_FLOWING_WATER) {
            this.outOfControlTicks = 0.0F;
        } else {
            ++this.outOfControlTicks;
        }

        if (!this.level.isClientSide && this.outOfControlTicks >= 60.0F) {
            this.ejectPassengers();
        }

        if (this.getHurtTime() > 0) {
            this.setHurtTime(this.getHurtTime() - 1);
        }

        if (this.getDamage() > 0.0F) {
            this.setDamage(this.getDamage() - 1.0F);
        }

        super.tick();
        this.tickLerp();
        if (this.isControlledByLocalInstance()) {
            if (!(this.getFirstPassenger() instanceof Player)) {
            }

            this.floatSpeeder();
            if (this.level.isClientSide) {
                this.controlSpeeder();
            }

            this.move(MoverType.SELF, this.getDeltaMovement());
        } else {
            this.setDeltaMovement(Vec3.ZERO);
        }

        this.checkInsideBlocks();
        List<Entity> list = this.level.getEntities(this, this.getBoundingBox().inflate((double)0.2F, (double)-0.01F, (double)0.2F), EntitySelector.pushableBy(this));
        if (!list.isEmpty()) {
            boolean flag = !this.level.isClientSide && !(this.getControllingPassenger() instanceof Player);

            for(int j = 0; j < list.size(); ++j) {
                Entity entity = list.get(j);
                if (!entity.hasPassenger(this)) {
                    if (flag && this.getPassengers().size() < 2 && !entity.isPassenger() && entity.getBbWidth() < this.getBbWidth() && entity instanceof LivingEntity && !(entity instanceof WaterAnimal) && !(entity instanceof Player)) {
                        entity.startRiding(this);
                    } else {
                        this.push(entity);
                    }
                }
            }
        }

    }

    private void tickLerp() {
        if (this.isControlledByLocalInstance()) {
            this.lerpSteps = 0;
            this.setPacketCoordinates(this.getX(), this.getY(), this.getZ());
        }

        if (this.lerpSteps > 0) {
            double d0 = this.getX() + (this.lerpX - this.getX()) / (double)this.lerpSteps;
            double d1 = this.getY() + (this.lerpY - this.getY()) / (double)this.lerpSteps;
            double d2 = this.getZ() + (this.lerpZ - this.getZ()) / (double)this.lerpSteps;
            double d3 = Mth.wrapDegrees(this.lerpYRot - (double)this.getYRot());
            this.setYRot(this.getYRot() + (float)d3 / (float)this.lerpSteps);
            this.setXRot(this.getXRot() + (float)(this.lerpXRot - (double)this.getXRot()) / (float)this.lerpSteps);
            --this.lerpSteps;
            this.setPos(d0, d1, d2);
            this.setRot(this.getYRot(), this.getXRot());
        }
    }

    private Speeder.Status getStatus() {
        Speeder.Status boat$status = this.isUnderwater();
        if (boat$status != null) {
            this.waterLevel = this.getBoundingBox().maxY;
            return boat$status;
        } else if (this.checkInWater()) {
            return Speeder.Status.IN_WATER;
        } else {
            float f = this.getGroundFriction();
            if (f > 0.0F) {
                this.landFriction = f;
                return Speeder.Status.ON_LAND;
            } else {
                return Speeder.Status.IN_AIR;
            }
        }
    }

    public float getWaterLevelAbove() {
        AABB aabb = this.getBoundingBox();
        int i = Mth.floor(aabb.minX);
        int j = Mth.ceil(aabb.maxX);
        int k = Mth.floor(aabb.maxY);
        int l = Mth.ceil(aabb.maxY - this.lastYd);
        int i1 = Mth.floor(aabb.minZ);
        int j1 = Mth.ceil(aabb.maxZ);
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        label39:
        for(int k1 = k; k1 < l; ++k1) {
            float f = 0.0F;

            for(int l1 = i; l1 < j; ++l1) {
                for(int i2 = i1; i2 < j1; ++i2) {
                    blockpos$mutableblockpos.set(l1, k1, i2);
                    FluidState fluidstate = this.level.getFluidState(blockpos$mutableblockpos);
                    if (fluidstate.is(FluidTags.WATER)) {
                        f = Math.max(f, fluidstate.getHeight(this.level, blockpos$mutableblockpos));
                    }

                    if (f >= 1.0F) {
                        continue label39;
                    }
                }
            }

            if (f < 1.0F) {
                return (float)blockpos$mutableblockpos.getY() + f;
            }
        }

        return (float)(l + 1);
    }

    public float getGroundFriction() {
        AABB aabb = this.getBoundingBox();
        AABB aabb1 = new AABB(aabb.minX, aabb.minY - 0.001D, aabb.minZ, aabb.maxX, aabb.minY, aabb.maxZ);
        int i = Mth.floor(aabb1.minX) - 1;
        int j = Mth.ceil(aabb1.maxX) + 1;
        int k = Mth.floor(aabb1.minY) - 1;
        int l = Mth.ceil(aabb1.maxY) + 1;
        int i1 = Mth.floor(aabb1.minZ) - 1;
        int j1 = Mth.ceil(aabb1.maxZ) + 1;
        VoxelShape voxelshape = Shapes.create(aabb1);
        float f = 0.0F;
        int k1 = 0;
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for(int l1 = i; l1 < j; ++l1) {
            for(int i2 = i1; i2 < j1; ++i2) {
                int j2 = (l1 != i && l1 != j - 1 ? 0 : 1) + (i2 != i1 && i2 != j1 - 1 ? 0 : 1);
                if (j2 != 2) {
                    for(int k2 = k; k2 < l; ++k2) {
                        if (j2 <= 0 || k2 != k && k2 != l - 1) {
                            blockpos$mutableblockpos.set(l1, k2, i2);
                            BlockState blockstate = this.level.getBlockState(blockpos$mutableblockpos);
                            if (!(blockstate.getBlock() instanceof WaterlilyBlock) && Shapes.joinIsNotEmpty(blockstate.getCollisionShape(this.level, blockpos$mutableblockpos).move((double)l1, (double)k2, (double)i2), voxelshape, BooleanOp.AND)) {
                                f += blockstate.getFriction(this.level, blockpos$mutableblockpos, this);
                                ++k1;
                            }
                        }
                    }
                }
            }
        }

        return f / (float)k1;
    }

    private boolean checkInWater() {
        AABB aabb = this.getBoundingBox();
        int i = Mth.floor(aabb.minX);
        int j = Mth.ceil(aabb.maxX);
        int k = Mth.floor(aabb.minY);
        int l = Mth.ceil(aabb.minY + 0.001D);
        int i1 = Mth.floor(aabb.minZ);
        int j1 = Mth.ceil(aabb.maxZ);
        boolean flag = false;
        this.waterLevel = -Double.MAX_VALUE;
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for(int k1 = i; k1 < j; ++k1) {
            for(int l1 = k; l1 < l; ++l1) {
                for(int i2 = i1; i2 < j1; ++i2) {
                    blockpos$mutableblockpos.set(k1, l1, i2);
                    FluidState fluidstate = this.level.getFluidState(blockpos$mutableblockpos);
                    if (fluidstate.is(FluidTags.WATER)) {
                        float f = (float)l1 + fluidstate.getHeight(this.level, blockpos$mutableblockpos);
                        this.waterLevel = Math.max((double)f, this.waterLevel);
                        flag |= aabb.minY < (double)f;
                    }
                }
            }
        }

        return flag;
    }

    @Nullable
    private Speeder.Status isUnderwater() {
        AABB aabb = this.getBoundingBox();
        double d0 = aabb.maxY + 0.001D;
        int i = Mth.floor(aabb.minX);
        int j = Mth.ceil(aabb.maxX);
        int k = Mth.floor(aabb.maxY);
        int l = Mth.ceil(d0);
        int i1 = Mth.floor(aabb.minZ);
        int j1 = Mth.ceil(aabb.maxZ);
        boolean flag = false;
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for(int k1 = i; k1 < j; ++k1) {
            for(int l1 = k; l1 < l; ++l1) {
                for(int i2 = i1; i2 < j1; ++i2) {
                    blockpos$mutableblockpos.set(k1, l1, i2);
                    FluidState fluidstate = this.level.getFluidState(blockpos$mutableblockpos);
                    if (fluidstate.is(FluidTags.WATER) && d0 < (double)((float)blockpos$mutableblockpos.getY() + fluidstate.getHeight(this.level, blockpos$mutableblockpos))) {
                        if (!fluidstate.isSource()) {
                            return Speeder.Status.UNDER_FLOWING_WATER;
                        }

                        flag = true;
                    }
                }
            }
        }

        return flag ? Speeder.Status.UNDER_WATER : null;
    }

    private void floatSpeeder() {
        double d0 = (double)-0.04F;
        double d1 = this.isNoGravity() ? 0.0D : (double)-0.04F;
        double d2 = 0.0D;
        this.invFriction = 0.9F;
        if (this.oldStatus == Speeder.Status.IN_AIR && this.status != Speeder.Status.IN_AIR && this.status != Speeder.Status.ON_LAND) {
            this.waterLevel = this.getY(1.0D);
            this.setPos(this.getX(), (double)(this.getWaterLevelAbove() - this.getBbHeight()) + 0.101D, this.getZ());
            this.setDeltaMovement(this.getDeltaMovement().multiply(1.0D, 0.0D, 1.0D));
            this.lastYd = 0.0D;
            this.status = Speeder.Status.IN_WATER;
        } else {
            if (this.status == Speeder.Status.IN_WATER) {
                d2 = (this.waterLevel - this.getY()) / (double)this.getBbHeight();
            } else if (this.status == Speeder.Status.UNDER_FLOWING_WATER) {
                d1 = -7.0E-4D;
            } else if (this.status == Speeder.Status.UNDER_WATER) {
                d2 = (double)0.01F;
            } else if (this.status == Speeder.Status.IN_AIR) {
                this.invFriction = 0.85F;
            } else if (this.status == Speeder.Status.ON_LAND) {
                if (this.getControllingPassenger() instanceof Player) {
                    this.landFriction /= 2.0F;
                }
            }

            Vec3 vec3 = this.getDeltaMovement();
            this.setDeltaMovement(vec3.x * (double)this.invFriction, vec3.y + d1, vec3.z * (double)this.invFriction);
            this.deltaRotation *= this.invFriction;
            if (d2 > 0.0D) {
                Vec3 vec31 = this.getDeltaMovement();
                this.setDeltaMovement(vec31.x, (vec31.y + d2 * 0.06153846016296973D) * 0.75D, vec31.z);
            }
        }

    }

    private void controlSpeeder() {
        if (this.isVehicle()) {
            float f = 0.0F;
            if (this.inputLeft) {
                --this.deltaRotation;
            }

            if (this.inputRight) {
                ++this.deltaRotation;
            }

            if (this.inputRight != this.inputLeft && !this.inputUp && !this.inputDown) {
                f += 0.005F;
            }

            this.setYRot(this.getYRot() + this.deltaRotation);
            if (this.inputUp) {
                f += 0.04F;
            }

            if (this.inputDown) {
                f -= 0.005F;
            }

            this.setDeltaMovement(this.getDeltaMovement().add((double)(Mth.sin(-this.getYRot() * ((float)Math.PI / 180F)) * f), 0.0D, (double)(Mth.cos(this.getYRot() * ((float)Math.PI / 180F)) * f)));
        }
    }

    public void positionRider(Entity p_38379_) {
        if (this.hasPassenger(p_38379_)) {
            float f = 0.0F;
            float f1 = (float)((this.isRemoved() ? (double)0.01F : this.getPassengersRidingOffset()) + p_38379_.getMyRidingOffset());
            if (this.getPassengers().size() > 1) {
                int i = this.getPassengers().indexOf(p_38379_);
                if (i == 0) {
                    f = 0.2F;
                } else {
                    f = -0.6F;
                }

                if (p_38379_ instanceof Animal) {
                    f += 0.2F;
                }
            }

            Vec3 vec3 = (new Vec3((double)f, 0.0D, 0.0D)).yRot(-this.getYRot() * ((float)Math.PI / 180F) - ((float)Math.PI / 2F));
            p_38379_.setPos(this.getX() + vec3.x, this.getY() + (double)f1, this.getZ() + vec3.z);
            p_38379_.setYRot(p_38379_.getYRot() + this.deltaRotation);
            p_38379_.setYHeadRot(p_38379_.getYHeadRot() + this.deltaRotation);
            this.clampRotation(p_38379_);
            if (p_38379_ instanceof Animal && this.getPassengers().size() > 1) {
                int j = p_38379_.getId() % 2 == 0 ? 90 : 270;
                p_38379_.setYBodyRot(((Animal)p_38379_).yBodyRot + (float)j);
                p_38379_.setYHeadRot(p_38379_.getYHeadRot() + (float)j);
            }

        }
    }

    public Vec3 getDismountLocationForPassenger(LivingEntity p_38357_) {
        Vec3 vec3 = getCollisionHorizontalEscapeVector((double)(this.getBbWidth() * Mth.SQRT_OF_TWO), (double)p_38357_.getBbWidth(), p_38357_.getYRot());
        double d0 = this.getX() + vec3.x;
        double d1 = this.getZ() + vec3.z;
        BlockPos blockpos = new BlockPos(d0, this.getBoundingBox().maxY, d1);
        BlockPos blockpos1 = blockpos.below();
        if (!this.level.isWaterAt(blockpos1)) {
            List<Vec3> list = Lists.newArrayList();
            double d2 = this.level.getBlockFloorHeight(blockpos);
            if (DismountHelper.isBlockFloorValid(d2)) {
                list.add(new Vec3(d0, (double)blockpos.getY() + d2, d1));
            }

            double d3 = this.level.getBlockFloorHeight(blockpos1);
            if (DismountHelper.isBlockFloorValid(d3)) {
                list.add(new Vec3(d0, (double)blockpos1.getY() + d3, d1));
            }

            for(Pose pose : p_38357_.getDismountPoses()) {
                for(Vec3 vec31 : list) {
                    if (DismountHelper.canDismountTo(this.level, vec31, p_38357_, pose)) {
                        p_38357_.setPose(pose);
                        return vec31;
                    }
                }
            }
        }

        return super.getDismountLocationForPassenger(p_38357_);
    }

    protected void clampRotation(Entity p_38322_) {
        p_38322_.setYBodyRot(this.getYRot());
        float f = Mth.wrapDegrees(p_38322_.getYRot() - this.getYRot());
        float f1 = Mth.clamp(f, -105.0F, 105.0F);
        p_38322_.yRotO += f1 - f;
        p_38322_.setYRot(p_38322_.getYRot() + f1 - f);
        p_38322_.setYHeadRot(p_38322_.getYRot());
    }

    public void onPassengerTurned(Entity p_38383_) {
        this.clampRotation(p_38383_);
    }

    protected void addAdditionalSaveData(CompoundTag p_38359_) {
        //p_38359_.putString("Type", this.getSpeederType().getName());
    }

    protected void readAdditionalSaveData(CompoundTag p_38338_) {
        if (p_38338_.contains("Type", 8)) {
            //this.setType(Speeder.Type.byName(p_38338_.getString("Type")));
        }

    }

    public InteractionResult interact(Player p_38330_, InteractionHand p_38331_) {
        if (p_38330_.isSecondaryUseActive()) {
            return InteractionResult.PASS;
        } else if (this.outOfControlTicks < 60.0F) {
            if (!this.level.isClientSide) {
                return p_38330_.startRiding(this) ? InteractionResult.CONSUME : InteractionResult.PASS;
            } else {
                return InteractionResult.SUCCESS;
            }
        } else {
            return InteractionResult.PASS;
        }
    }

    protected void checkFallDamage(double p_38307_, boolean p_38308_, BlockState p_38309_, BlockPos p_38310_) {
        this.lastYd = this.getDeltaMovement().y;
        if (!this.isPassenger()) {
            if (p_38308_) {
                if (this.fallDistance > 3.0F) {
                    if (this.status != Speeder.Status.ON_LAND) {
                        this.resetFallDistance();
                        return;
                    }

                    this.causeFallDamage(this.fallDistance, 1.0F, DamageSource.FALL);
                    if (!this.level.isClientSide && !this.isRemoved()) {
                        this.kill();
                        if (this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
                            for(int i = 0; i < 3; ++i) {
                                this.spawnAtLocation(Items.NETHER_STAR);
                            }

                            for(int j = 0; j < 2; ++j) {
                                this.spawnAtLocation(Items.STICK);
                            }
                        }
                    }
                }

                this.resetFallDistance();
            } else if (!this.level.getFluidState(this.blockPosition().below()).is(FluidTags.WATER) && p_38307_ < 0.0D) {
                this.fallDistance -= (float)p_38307_;
            }

        }
    }

    public void setDamage(float p_38312_) {
        this.entityData.set(DATA_ID_DAMAGE, p_38312_);
    }

    public float getDamage() {
        return this.entityData.get(DATA_ID_DAMAGE);
    }

    public void setHurtTime(int p_38355_) {
        this.entityData.set(DATA_ID_HURT, p_38355_);
    }

    public int getHurtTime() {
        return this.entityData.get(DATA_ID_HURT);
    }

    public void setHurtDir(int p_38363_) {
        this.entityData.set(DATA_ID_HURTDIR, p_38363_);
    }

    public int getHurtDir() {
        return this.entityData.get(DATA_ID_HURTDIR);
    }

    protected boolean canAddPassenger(Entity p_38390_) {
        return this.getPassengers().size() < 2 && !this.isEyeInFluid(FluidTags.WATER);
    }

    @Nullable
    public Entity getControllingPassenger() {
        return this.getFirstPassenger();
    }

    public void setInput(boolean p_38343_, boolean p_38344_, boolean p_38345_, boolean p_38346_) {
        this.inputLeft = p_38343_;
        this.inputRight = p_38344_;
        this.inputUp = p_38345_;
        this.inputDown = p_38346_;
    }

    @Override
    public Packet<?> getAddEntityPacket() {
        return NetworkHooks.getEntitySpawningPacket(this);
    }

    public boolean isUnderWater() {
        return this.status == Speeder.Status.UNDER_WATER || this.status == Speeder.Status.UNDER_FLOWING_WATER;
    }

    // Forge: Fix MC-119811 by instantly completing lerp on board
    @Override
    protected void addPassenger(Entity passenger) {
        super.addPassenger(passenger);
        if (this.isControlledByLocalInstance() && this.lerpSteps > 0) {
            this.lerpSteps = 0;
            this.absMoveTo(this.lerpX, this.lerpY, this.lerpZ, (float)this.lerpYRot, (float)this.lerpXRot);
        }
    }

    public ItemStack getPickResult() {
        return new ItemStack(this.getDropItem());
    }

    public static enum Status {
        IN_WATER,
        UNDER_WATER,
        UNDER_FLOWING_WATER,
        ON_LAND,
        IN_AIR;
    }
}
Spoiler

entity renderer

package com.freyebeans.batoohell.entities.rendering;

import com.freyebeans.batoohell.BatOutOfHell;
import com.freyebeans.batoohell.entities.Speeder;
import com.freyebeans.batoohell.entities.rendering.model.SpeederModel;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;


public class SpeederRenderer<T extends Speeder> extends EntityRenderer<Speeder> {
    private static final ResourceLocation SPEEDER_TEXTURE = new ResourceLocation(BatOutOfHell.MOD_ID, "textures/entity/hell_speeder.png");
    protected final EntityModel<T> model;

    public SpeederRenderer(EntityRendererProvider.Context context) {
        super(context);
        this.shadowRadius = 0.8F;
        this.model = new SpeederModel<>(context.bakeLayer(SpeederModel.SPEEDER_LAYER_LOCATION));
    }

    public void render(T p_113929_, float p_113930_, float p_113931_, PoseStack p_113932_, MultiBufferSource p_113933_, int p_113934_) {
        p_113932_.pushPose();
        p_113932_.translate(0.0D, 0.375D, 0.0D);
        p_113932_.mulPose(Vector3f.YP.rotationDegrees(180.0F - p_113930_));
        float f = (float)p_113929_.getHurtTime() - p_113931_;
        float f1 = p_113929_.getDamage() - p_113931_;
        if (f1 < 0.0F) {
            f1 = 0.0F;
        }

        if (f > 0.0F) {
            p_113932_.mulPose(Vector3f.XP.rotationDegrees(Mth.sin(f) * f * f1 / 10.0F * (float)p_113929_.getHurtDir()));
        }

        ResourceLocation resourcelocation = getTextureLocation(p_113929_);
        p_113932_.scale(-1.0F, -1.0F, 1.0F);
        p_113932_.mulPose(Vector3f.YP.rotationDegrees(90.0F));
        this.model.setupAnim(p_113929_, p_113931_, 0.0F, -0.1F, 0.0F, 0.0F);
        VertexConsumer vertexconsumer = p_113933_.getBuffer(this.model.renderType(resourcelocation));
        this.model.renderToBuffer(p_113932_, vertexconsumer, p_113934_, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F);

        p_113932_.popPose();
        super.render(p_113929_, p_113930_, p_113931_, p_113932_, p_113933_, p_113934_);
    }

    @Override
    public ResourceLocation getTextureLocation(Speeder entity) {
        return SPEEDER_TEXTURE;
    }
}
Spoiler

entity model made with blockbench

package com.freyebeans.batoohell.entities.rendering.model;// Made with Blockbench 4.3.1
// Exported for Minecraft version 1.17 - 1.18 with Mojang mappings
// Paste this class into your mod and generate all required imports


import com.freyebeans.batoohell.BatOutOfHell;
import com.freyebeans.batoohell.entities.Speeder;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.*;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;

public class SpeederModel<T extends Speeder> extends EntityModel<T> {
	// This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor
	public static final ModelLayerLocation SPEEDER_LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation(BatOutOfHell.MOD_ID, "hell_speeder"), "main");
	private final ModelPart everything;
	private final ModelPart smogshield;
	private final ModelPart right_tank;
	private final ModelPart left_tank;
	private final ModelPart right_panel;
	private final ModelPart left_panel;
	private final ModelPart seat_back;
	private final ModelPart exhaust_pipe;
	private final ModelPart exhaust_end;

	public SpeederModel(ModelPart root) {
		super(RenderType::entityCutoutNoCull);
		this.everything = root.getChild("everything");
		this.smogshield = everything.getChild("smogshield");
		this.right_tank = everything.getChild("right_tank");
		this.left_tank = everything.getChild("left_tank");
		this.right_panel = everything.getChild("right_panel");
		this.left_panel = everything.getChild("left_panel");
		this.seat_back = everything.getChild("chair_back");
		this.exhaust_pipe = everything.getChild("exhaust_pipe");
		this.exhaust_end = exhaust_pipe.getChild("exhaust_end");
	}

	public static LayerDefinition createBodyLayer() {
		MeshDefinition meshdefinition = new MeshDefinition();
		PartDefinition partdefinition = meshdefinition.getRoot();

		PartDefinition everything = partdefinition.addOrReplaceChild("everything", CubeListBuilder.create().texOffs(66, 14).addBox(4.0F, 0.0F, -17.0F, 1.0F, 1.0F, 10.0F, new CubeDeformation(0.0F))
		.texOffs(0, 6).addBox(3.0F, -1.5F, -7.0F, 6.0F, 4.0F, 2.0F, new CubeDeformation(0.0F))
		.texOffs(0, 52).addBox(-7.0F, -2.5F, -5.0F, 14.0F, 6.0F, 5.0F, new CubeDeformation(0.0F))
		.texOffs(46, 28).addBox(-7.0F, -2.5F, 11.0F, 14.0F, 5.0F, 8.0F, new CubeDeformation(0.0F))
		.texOffs(46, 0).addBox(-7.0F, 0.5F, 0.0F, 14.0F, 3.0F, 11.0F, new CubeDeformation(0.0F))
		.texOffs(46, 14).addBox(-4.0F, -0.5F, 1.0F, 8.0F, 1.0F, 7.0F, new CubeDeformation(0.0F))
		.texOffs(0, 23).addBox(-8.0F, -0.5F, -5.0F, 1.0F, 2.0F, 21.0F, new CubeDeformation(0.0F))
		.texOffs(0, 0).addBox(7.0F, -0.5F, -5.0F, 1.0F, 2.0F, 21.0F, new CubeDeformation(0.0F))
		.texOffs(12, 64).addBox(-5.0F, 0.0F, -17.0F, 1.0F, 1.0F, 10.0F, new CubeDeformation(0.0F))
		.texOffs(72, 54).addBox(-9.0F, -0.5F, -22.0F, 6.0F, 2.0F, 5.0F, new CubeDeformation(0.0F))
		.texOffs(0, 0).addBox(-9.0F, -1.5F, -7.0F, 6.0F, 4.0F, 2.0F, new CubeDeformation(0.0F))
		.texOffs(56, 42).addBox(7.0F, -0.5F, -17.0F, 2.0F, 2.0F, 10.0F, new CubeDeformation(0.0F))
		.texOffs(42, 52).addBox(-9.0F, -0.5F, -17.0F, 2.0F, 2.0F, 10.0F, new CubeDeformation(0.0F))
		.texOffs(70, 41).addBox(3.0F, -0.5F, -22.0F, 6.0F, 2.0F, 5.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 18.0F, 0.0F));

		PartDefinition smogshield = everything.addOrReplaceChild("smogshield", CubeListBuilder.create().texOffs(23, 0).addBox(-6.0F, -3.0F, 0.0F, 12.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, -2.5F, -3.0F, -0.2618F, 0.0F, 0.0F));

		PartDefinition left_tank = everything.addOrReplaceChild("left_tank", CubeListBuilder.create().texOffs(48, 67).addBox(-1.5F, -1.5F, -4.0F, 3.0F, 3.0F, 8.0F, new CubeDeformation(0.0F))
		.texOffs(26, 67).addBox(-1.5F, -1.5F, -4.0F, 3.0F, 3.0F, 8.0F, new CubeDeformation(-0.5F)), PartPose.offset(4.5F, 0.5F, -12.0F));

		PartDefinition exhaust_pipe = everything.addOrReplaceChild("exhaust_pipe", CubeListBuilder.create().texOffs(26, 52).addBox(-1.0F, -1.5F, -2.0F, 2.0F, 3.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offset(8.0F, 2.0F, 11.0F));

		PartDefinition exhaust_end = exhaust_pipe.addOrReplaceChild("exhaust_end", CubeListBuilder.create().texOffs(0, 12).addBox(-0.5F, -1.0F, 0.0F, 1.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 10.0F));

		PartDefinition chair_back = everything.addOrReplaceChild("chair_back", CubeListBuilder.create().texOffs(62, 67).addBox(-4.0F, -0.5F, 1.0F, 8.0F, 1.0F, 5.0F, new CubeDeformation(0.0F))
		.texOffs(5, 12).addBox(-2.0F, -0.5F, 0.0F, 4.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 7.0F, 1.0472F, 0.0F, 0.0F));

		PartDefinition left_panel = everything.addOrReplaceChild("left_panel", CubeListBuilder.create().texOffs(25, 28).addBox(0.0F, 0.0F, -9.5F, 1.0F, 5.0F, 19.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(7.5F, -1.5F, 5.5F, 0.0F, 0.0F, -0.3927F));

		PartDefinition right_panel = everything.addOrReplaceChild("right_panel", CubeListBuilder.create().texOffs(25, 4).addBox(-1.0F, 0.0F, -9.5F, 1.0F, 5.0F, 19.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-7.5F, -1.5F, 5.5F, 0.0F, 0.0F, 0.3927F));

		PartDefinition right_tank = everything.addOrReplaceChild("right_tank", CubeListBuilder.create().texOffs(0, 63).addBox(-1.5F, -1.5F, -4.0F, 3.0F, 3.0F, 8.0F, new CubeDeformation(0.0F))
		.texOffs(58, 56).addBox(-1.5F, -1.5F, -4.0F, 3.0F, 3.0F, 8.0F, new CubeDeformation(-0.5F)), PartPose.offset(-4.5F, 0.5F, -12.0F));

		return LayerDefinition.create(meshdefinition, 128, 128);
	}

	@Override
	public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {

	}

	@Override
	public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
		everything.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		right_tank.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		right_panel.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		left_tank.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		left_panel.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		exhaust_pipe.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		exhaust_end.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		seat_back.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
		smogshield.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
	}
}

 

Spoiler

main mod class

package com.freyebeans.batoohell;

import com.freyebeans.batoohell.entities.rendering.SpeederRenderer;
import com.freyebeans.batoohell.entities.rendering.model.SpeederModel;
import com.freyebeans.batoohell.util.ContentRegister;
import com.mojang.logging.LogUtils;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.event.entity.EntityAttributeCreationEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.InterModComms;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.slf4j.Logger;

import java.util.stream.Collectors;

// The value here should match an entry in the META-INF/mods.toml file
@Mod("batoohell")
public class BatOutOfHell
{
    // Directly reference a slf4j logger
    private static final Logger LOGGER = LogUtils.getLogger();
    public static String MOD_ID = "batoohell";
    public BatOutOfHell()
    {
        // Register the setup method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        // Register the enqueueIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC);
        // Register the processIMC method for modloading
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC);

        ContentRegister.init();
        // Register ourselves for server and other game events we are interested in
        MinecraftForge.EVENT_BUS.register(this);
    }

    private void setup(final FMLCommonSetupEvent event)
    {
        // some preinit code
        LOGGER.info("HELLO FROM PREINIT");
        LOGGER.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
    }

    private void enqueueIMC(final InterModEnqueueEvent event)
    {
        // Some example code to dispatch IMC to another mod
        InterModComms.sendTo("qoldats", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";});
    }

    private void processIMC(final InterModProcessEvent event)
    {
        // Some example code to receive and process InterModComms from other mods
        LOGGER.info("Got IMC {}", event.getIMCStream().
                map(m->m.messageSupplier().get()).
                collect(Collectors.toList()));
    }

    // You can use SubscribeEvent and let the Event Bus discover methods to call
    @SubscribeEvent
    public void onServerStarting(ServerStartingEvent event)
    {
        // Do something when the server starts
        LOGGER.info("HELLO from server starting");
    }

    // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD
    // Event bus for receiving Registry Events)
    @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
    public static class RegistryEvents
    {
        @SubscribeEvent
        public static void registerAttributes(EntityAttributeCreationEvent event) {
            //event.put(ContentRegister.WINDIGO.get(), Speeder.createAttributes().build());
        }
        @SubscribeEvent
        public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent)
        {
            // Register a new block here
            LOGGER.info("HELLO from Register Block");
        }
    }
    public static final CreativeModeTab TAB_CARDS = new CreativeModeTab("uno_cards") {
        @Override
        public ItemStack makeIcon() {
            return new ItemStack(ContentRegister.CARRION.get());
        }
    };

    @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
    public static class ClientEvents
    {
        @SubscribeEvent
        public static void registerLayers(EntityRenderersEvent.RegisterLayerDefinitions event) {
            event.registerLayerDefinition(SpeederModel.SPEEDER_LAYER_LOCATION, SpeederModel::createBodyLayer);
        }

        @SubscribeEvent
        public static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) {
            event.registerEntityRenderer(ContentRegister.HELL_SPEEDER.get(), SpeederRenderer::new);
        }
    }
}

 

Spoiler

content register

package com.freyebeans.batoohell.util;


import com.freyebeans.batoohell.BatOutOfHell;
import com.freyebeans.batoohell.effect.QoLDaTSEffect;
import com.freyebeans.batoohell.entities.Speeder;
import com.freyebeans.batoohell.item.HellSpeederItem;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.MobCategory;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.*;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.state.properties.WoodType;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class ContentRegister {

    public static DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, BatOutOfHell.MOD_ID);
    public static DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, BatOutOfHell.MOD_ID);
    public static DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, BatOutOfHell.MOD_ID);
    public static DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, BatOutOfHell.MOD_ID);

    public static void init() {

        ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
        BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
        EFFECTS.register(FMLJavaModLoadingContext.get().getModEventBus());
        ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
    }

  //there was blocks effects and items here but all of it is to be removed later but its not important
  
    //entities
    public static final RegistryObject<EntityType<Speeder>> HELL_SPEEDER = ENTITIES.register("hell_speeder", () -> EntityType.Builder.<Speeder>of(Speeder::new, MobCategory.MISC).sized(1.375F, 0.5625F).clientTrackingRange(10).immuneTo(Blocks.LAVA).fireImmune().build(new ResourceLocation(BatOutOfHell.MOD_ID, "hell_speeder").toString()));
    public static final RegistryObject<Item> HELL_SPEEDER_ITEM = ITEMS.register("hell_speeder", ()-> new HellSpeederItem(new Item.Properties().fireResistant().stacksTo(1).tab(CreativeModeTab.TAB_TRANSPORTATION)));


}

 

Spoiler

the class for the item

package com.freyebeans.batoohell.item;

import com.freyebeans.batoohell.entities.Speeder;
import net.minecraft.core.BlockPos;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntitySelector;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;

import java.util.List;
import java.util.function.Predicate;

public class HellSpeederItem extends Item {
    private static final Predicate<Entity> ENTITY_PREDICATE = EntitySelector.NO_SPECTATORS.and(Entity::isPickable);

    public HellSpeederItem(Properties properties) {
        super(properties);
    }

    public InteractionResultHolder<ItemStack> use(Level p_40622_, Player p_40623_, InteractionHand p_40624_) {
        ItemStack itemstack = p_40623_.getItemInHand(p_40624_);
        HitResult hitresult = getPlayerPOVHitResult(p_40622_, p_40623_, ClipContext.Fluid.ANY);
        if (hitresult.getType() == HitResult.Type.MISS) {
            return InteractionResultHolder.pass(itemstack);
        } else {
            Vec3 vec3 = p_40623_.getViewVector(1.0F);
            double d0 = 5.0D;
            List<Entity> list = p_40622_.getEntities(p_40623_, p_40623_.getBoundingBox().expandTowards(vec3.scale(5.0D)).inflate(1.0D), ENTITY_PREDICATE);
            if (!list.isEmpty()) {
                Vec3 vec31 = p_40623_.getEyePosition();

                for(Entity entity : list) {
                    AABB aabb = entity.getBoundingBox().inflate((double)entity.getPickRadius());
                    if (aabb.contains(vec31)) {
                        return InteractionResultHolder.pass(itemstack);
                    }
                }
            }

            if (hitresult.getType() == HitResult.Type.BLOCK) {
                Speeder boat = new Speeder(p_40622_, hitresult.getLocation().x, hitresult.getLocation().y, hitresult.getLocation().z);
                boat.setYRot(p_40623_.getYRot());
                if (!p_40622_.noCollision(boat, boat.getBoundingBox())) {
                    return InteractionResultHolder.fail(itemstack);
                } else {
                    if (!p_40622_.isClientSide) {
                        p_40622_.addFreshEntity(boat);
                        p_40622_.gameEvent(p_40623_, GameEvent.ENTITY_PLACE, new BlockPos(hitresult.getLocation()));
                        if (!p_40623_.getAbilities().instabuild) {
                            itemstack.shrink(1);
                        }
                    }

                    p_40623_.awardStat(Stats.ITEM_USED.get(this));
                    return InteractionResultHolder.sidedSuccess(itemstack, p_40622_.isClientSide());
                }
            } else {
                return InteractionResultHolder.pass(itemstack);
            }
        }
    }

}

 

i did take most of this from the boat code because it was most similar to what i am making.

Edited by FREyebeans2506
the image disappeared and became some string of letters because google sites is stupid
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Use Temu coupon code $100 off [acq783769] for Australia and new zealand. Also get special 30% discount Plus get free shipping Temu has always been a shopper's paradise, offering a vast collection of trending items at unbeatable prices. With fast delivery and free shipping to 67 countries, it's no wonder Temu has become a go-to platform for savvy shoppers. Now, with these exclusive Temu coupon codes, you can enjoy even more savings: act581784: Temu coupon code 40% off for existing users act581784: $100 off Temu coupon for new customers act581784: $100 off Temu coupon for existing customers act581784: 40% discount for new users act581784: Temu coupon code 40 off for existing and new users Why You Shouldn't Miss Out on the Temu Coupon Code 40% Off The Temu coupon code 40% off is a game-changer for both new and existing customers. Whether you're a first-time user or a loyal Temu shopper, these codes offer substantial savings on your purchases. With a flat 40% extra off, you can stretch your budget further and indulge in more of your favorite items. Maximizing Your Savings with Temu 40 Off Coupon Code To make the most of your Temu shopping experience, it's crucial to understand how to apply these coupon codes effectively. When you use the Temu coupon code 40 off, you're not just saving money – you're unlocking a world of possibilities. From fashion to home decor, electronics to beauty products, your 40% discount applies across a wide range of categories. How to Apply Your Temu Coupon Code 40% Off Using your Temu coupon code 40% off is a breeze. Here's a step-by-step guide to ensure you don't miss out on these incredible savings: Browse through Temu's extensive collection and add your desired items to your cart. Proceed to checkout when you're ready to make your purchase. Look for the "Promo Code" or "Coupon Code" field. Enter your Temu coupon code 40 off [act581784]. Watch as your total amount gets reduced by a whopping 40%! The Power of Temu Coupon Code 40 Off First Order For those new to Temu, the Temu coupon code 40% off first order is an excellent opportunity to experience the platform's offerings at a discounted price. This introductory offer allows you to explore Temu's vast catalog while enjoying significant savings on your inaugural purchase.Be sure to use it before it expires!
    • Use Temu Coupon Code $100 Off [act965193] if you are living in California USA. Temu doesn't let you use many coupons at once, but you can still save more. New users get an extra 10% off the 30% discount. Also, text alerts give you 20% off. Using these with Temu's 90% off Daily Deals helps you save a lot. How to use Temu Coupon Code $100 Off [act965193] Both new and existing users at Temu can save a lot by using coupon codes and bundles. New users get a $200 discount with the code aci384098 on their first buy. This is a big welcome bonus that helps them save right away. Follow below steps to apply Temu Coupon Code $100 Off [act965193] Choose Your Items: Pick the products you want to buy from TEMU. Go to Checkout: When you are ready to pay, go to the checkout page. Enter the Code: Type (act847220) into the coupon code box. Enjoy Your Savings: Your total will be reduced, and you'll save money on your purchase. Keep an eye on new deals to save more. Check the Temu app, sign up for newsletters, and follow Temu on social media. Sites like RetailMeNot or Coupons.com also list Temu coupon codes, so you won't miss out.   Using these tips, shopping on Temu can be a smart way to save money. Plan your buys with sale cycles in mind, stack coupons wisely, and watch for new deals. This will make your shopping trips more rewarding.   Temu Coupon Codes & Bundles: New Installs and Existing Users For existing customers, the code aci384098 also gives $200 off. The Temu $200 Coupon Bundle is great for both new and current users. It includes $120 worth of coupons. Plus, Temu offers a 40% discount with certain codes for everyone.   Temu also has special app discounts. By signing up with the code aci384098 and spending $200 or more, customers can save $200 plus get 30% off on their purchase. The code aci384098 also gives a $200 discount and an extra 50% off on the next buy. This is a great way to thank users for their engagement.   Shopping at Temu can lead to big savings. The average discount is an impressive 59%, with 84% of orders getting free shipping or gifts. About 48% of discounts have a time limit, encouraging shoppers to act fast. With deals like a $100 coupon bundle for new users and savings from the code aci384098, Temu offers many ways to save.   Existing customers also have many ways to save, like app alerts, website coupons, and referral programs. There are also games, seasonal sales, and discounts on certain items. This means both new and current users have lots of options to save, showing Temu's dedication to rewarding users.   Comparing Temu Coupon Codes with Other Retailers   Looking at the world of online shopping, comparing Temu coupon codes with others shows Temu's big competitive advantages.   Advantages of Temu Coupons   Temu's coupons offer big discounts, often more than other stores. This means customers save a lot of money. Temu also throws in freebies, making their coupons even more valuable.   Temu's coupons work on many products, not just a few. This makes it easy for customers to save on what they buy.   How Temu Stands Out in the Market   When we look at Temu vs. other retailers, Temu's deals are made with the customer in mind. They focus on what shoppers want and need. This makes Temu's coupons not just competitive but also very attractive to many buyers.   Our benchmarking deals show Temu leading in coupon offers. They offer big discounts and special perks. This makes Temu stand out in the online shopping world.   Conclusion Using Temu coupon codes and bundles helps save money and make shopping better. For new and returning customers, codes like "acr880792" and "aci384098" offer big discounts. New users get £20 off their first order and up to 50% off on various deals. Temu offers many coupons for smart shoppers to save more. Whether it's standalone discounts, special deals, or loyalty rewards, using these codes can cut down costs. This way, shoppers get quality products at great prices, from $1 phone cases to discounted electronics. It's important to keep up with new discounts and promotions. By watching daily deals and signing up for alerts, shoppers won't miss out on great offers. Temu connects manufacturers directly with consumers, leading to lower costs. This unique approach, along with big savings from coupons, makes Temu a top choice for budget-friendly shopping. Start your Temu shopping today for unmatched savings and satisfaction.  
    • Obtén hasta 90% de descuento en Temu utilizando el código [act892435]. Además, disfruta de $100 de descuento (aproximadamente 1,750 MXN) en tu primer pedido. Disponible para nuevos y clientes existentes en México. En Temu encontrarás una amplia gama de productos, desde ropa hasta tecnología, todos a precios increíbles. Aprovecha este código hoy mismo y comienza a ahorrar en tus compras. Temu hace que tus compras sean fáciles y accesibles, asegurando que obtengas la mejor calidad al mejor precio. Looking for the best deals and discounts? The Temu coupon code [act892435] or [acq943609] offers fantastic savings for both new and existing customers. Whether you're placing your first order or restocking your favorites, these coupon codes unlock discounts of up to 90% and an additional $100 off on selected items. Plus, enjoy the added benefit of free shipping on select orders. This guide will show you how to make the most of these deals and maximize your savings on Temu. How to Use the Temu Coupon Code [act892435] or [acq943609] Applying the Temu coupon code is quick and easy. Here’s how to redeem it for maximum savings: 1. Visit the Temu Website: Explore Temu’s wide range of products, including fashion, electronics, and home goods. 2. Add Items to Your Cart: Choose the products you want and add them to your shopping cart. 3. Proceed to Checkout: Click on your cart and proceed to checkout when you're ready. 4. Enter the Coupon Code: In the "Coupon Code" field at checkout, enter [act892435] or [acq943609] and click "Apply." 5. Enjoy Your Savings: You’ll instantly see the $100 discount along with additional savings of up to 90%, depending on the items selected. Benefits of Temu Coupon Codes [act892435] or [acq943609] for First-Time Users and Existing Customers Whether you're a new customer or a regular shopper, the Temu coupon code offers unbeatable discounts. Here's how both new and existing users can benefit: • First-Time Users: New customers using the Temu coupon code [act892435] or [acq943609] on their first order get $100 off, along with discounts ranging from 30% to 90% on selected products. It’s the perfect opportunity to try out Temu’s product range without overspending. • Existing Customers: Loyal shoppers can continue to enjoy significant savings by applying the same coupon code on subsequent orders. Restock your favorites or discover new items at discounted prices. • Free Shipping: Using the Temu coupon code [act892435] or [acq943609] can also qualify you for free shipping on selected items, further increasing your overall savings. Breakdown of Discounts with Temu Coupon Code [act892435] or [acq943609] With the Temu coupon code [act892435] or [acq943609], you’re not limited to just $100 off. You can also enjoy varying levels of discounts on a wide range of products. Here’s how it works: • 30% Discount: Perfect for budget-friendly products and everyday essentials. Shop clothing, beauty products, and home goods at 30% off. • 40% Discount: Ideal for mid-range purchases such as electronics, gadgets, and household items. • 50% Discount: Save big on high-end gadgets, designer apparel, and premium beauty products with 50% off. • 70% Discount: Excellent for those looking for luxury items like branded accessories and upscale electronics. • 90% Discount: The ultimate deal for savvy shoppers. Enjoy top-tier products like tech and home goods at a fraction of the price. Maximize Your Savings on First Orders, Free Shipping, and More with Temu Coupon Code [act892435] or [acq943609] Here are some top tips to get the most value from the Temu coupon code [act892435] or [acq943609]: 1. First Order Savings: For first-time users, using the code [act892435] or [acq943609] on your first order guarantees $100 off, making it the perfect way to kickstart your shopping experience at Temu. 2. Look for Free Shipping: Check if your items qualify for free shipping by applying the coupon code at checkout. It’s a great way to save even more on your total purchase. 3. Shop During Major Sales: Combine the coupon code with major sales events like Black Friday or Cyber Monday for even greater savings. 4. Buy in Bulk: Bulk purchases allow you to maximize the value of the $100 discount, especially if you’re buying items across various categories. 5. Check Product Eligibility: Make sure the products you’re adding to your cart qualify for higher percentage discounts. Some items may only offer 30%-50% off, while others can go up to 90%. FAQs About Temu Coupon Code [act892435] or [acq943609] 1. Is the Temu coupon code verified and working?  Yes, the Temu coupon codes [act892435] and [acq943609] are verified and currently active. Both codes offer up to $100 off, along with percentage discounts of up to 90%. 2. How much can I save with the Temu coupon code?  Using the coupon codes [act892435] or [acq943609], you can get $100 off plus additional percentage-based discounts ranging from 30% to 90%, depending on the products you choose. 3. Can both first-time users and existing customers use these coupon codes?  Absolutely! Both new and existing customers can take advantage of the Temu coupon codes [act892435] or [acq943609]. First-time users can apply the code for their first order, while loyal customers can continue saving on subsequent purchases. 4. Does the coupon code apply to free shipping?  In many cases, using the Temu coupon code [act892435] or [acq943609] may qualify you for free shipping, depending on the items and promotions available at the time of purchase. Conclusion: Don’t Miss Out on These Massive Savings with Temu Coupon Code [act892435] or [acq943609] The Temu coupon code [act892435] or [acq943609] provides an excellent opportunity to save big on a wide variety of products. Whether you're a first-time user placing your first order or an existing customer looking to restock, these coupon codes guarantee substantial savings. Take advantage of discounts up to 90%, free shipping on select orders, and $100 off when you shop at Temu. Don’t wait—start shopping today and use the coupon codes [act892435] or [acq943609] to unlock the best possible deals! Happy shopping!
    • Get up to 90% off at Temu using coupon code [act892435]. Receive $100 off (5,650 PHP) on your first order. Available for both new and existing customers in the Philippines. Get up to 90% off at Temu using the coupon code [act892435]. Receive $100 off on your first order, available for both new and existing customers in all country. Temu offers a diverse range of products from clothing to gadgets, all at unbeatable prices. Start saving today and enjoy a seamless shopping experience. Whether you're a first-time buyer or a regular customer, Temu helps you get more for less. Use the code now and turn your shopping into a rewarding experience filled with savings. Looking for the best deals and discounts? The Temu coupon code [act892435] or [acq943609] offers fantastic savings for both new and existing customers. Whether you're placing your first order or restocking your favorites, these coupon codes unlock discounts of up to 90% and an additional $100 off on selected items. Plus, enjoy the added benefit of free shipping on select orders. This guide will show you how to make the most of these deals and maximize your savings on Temu. How to Use the Temu Coupon Code [act892435] or [acq943609] Applying the Temu coupon code is quick and easy. Here’s how to redeem it for maximum savings: 1. Visit the Temu Website: Explore Temu’s wide range of products, including fashion, electronics, and home goods. 2. Add Items to Your Cart: Choose the products you want and add them to your shopping cart. 3. Proceed to Checkout: Click on your cart and proceed to checkout when you're ready. 4. Enter the Coupon Code: In the "Coupon Code" field at checkout, enter [act892435] or [acq943609] and click "Apply." 5. Enjoy Your Savings: You’ll instantly see the $100 discount along with additional savings of up to 90%, depending on the items selected. Benefits of Temu Coupon Codes [act892435] or [acq943609] for First-Time Users and Existing Customers Whether you're a new customer or a regular shopper, the Temu coupon code offers unbeatable discounts. Here's how both new and existing users can benefit: • First-Time Users: New customers using the Temu coupon code [act892435] or [acq943609] on their first order get $100 off, along with discounts ranging from 30% to 90% on selected products. It’s the perfect opportunity to try out Temu’s product range without overspending. • Existing Customers: Loyal shoppers can continue to enjoy significant savings by applying the same coupon code on subsequent orders. Restock your favorites or discover new items at discounted prices. • Free Shipping: Using the Temu coupon code [act892435] or [acq943609] can also qualify you for free shipping on selected items, further increasing your overall savings. Breakdown of Discounts with Temu Coupon Code [act892435] or [acq943609] With the Temu coupon code [act892435] or [acq943609], you’re not limited to just $100 off. You can also enjoy varying levels of discounts on a wide range of products. Here’s how it works: • 30% Discount: Perfect for budget-friendly products and everyday essentials. Shop clothing, beauty products, and home goods at 30% off. • 40% Discount: Ideal for mid-range purchases such as electronics, gadgets, and household items. • 50% Discount: Save big on high-end gadgets, designer apparel, and premium beauty products with 50% off. • 70% Discount: Excellent for those looking for luxury items like branded accessories and upscale electronics. • 90% Discount: The ultimate deal for savvy shoppers. Enjoy top-tier products like tech and home goods at a fraction of the price. Maximize Your Savings on First Orders, Free Shipping, and More with Temu Coupon Code [act892435] or [acq943609] Here are some top tips to get the most value from the Temu coupon code [act892435] or [acq943609]: 1. First Order Savings: For first-time users, using the code [act892435] or [acq943609] on your first order guarantees $100 off, making it the perfect way to kickstart your shopping experience at Temu. 2. Look for Free Shipping: Check if your items qualify for free shipping by applying the coupon code at checkout. It’s a great way to save even more on your total purchase. 3. Shop During Major Sales: Combine the coupon code with major sales events like Black Friday or Cyber Monday for even greater savings. 4. Buy in Bulk: Bulk purchases allow you to maximize the value of the $100 discount, especially if you’re buying items across various categories. 5. Check Product Eligibility: Make sure the products you’re adding to your cart qualify for higher percentage discounts. Some items may only offer 30%-50% off, while others can go up to 90%. FAQs About Temu Coupon Code [act892435] or [acq943609] 1. Is the Temu coupon code verified and working? Yes, the Temu coupon codes [act892435] and [acq943609] are verified and currently active. Both codes offer up to $100 off, along with percentage discounts of up to 90%. 2. How much can I save with the Temu coupon code? Using the coupon codes [act892435] or [acq943609], you can get $100 off plus additional percentage-based discounts ranging from 30% to 90%, depending on the products you choose. 3. Can both first-time users and existing customers use these coupon codes? Absolutely! Both new and existing customers can take advantage of the Temu coupon codes [act892435] or [acq943609]. First-time users can apply the code for their first order, while loyal customers can continue saving on subsequent purchases. 4. Does the coupon code apply to free shipping? In many cases, using the Temu coupon code [act892435] or [acq943609] may qualify you for free shipping, depending on the items and promotions available at the time of purchase. 5. Are there any exclusions with these coupon codes? While these coupon codes offer excellent discounts, some high-percentage offers may not apply to every item. Be sure to check product eligibility before completing your purchase. Conclusion: Don’t Miss Out on These Massive Savings with Temu Coupon Code [act892435] or [acq943609] The Temu coupon code [act892435] or [acq943609] provides an excellent opportunity to save big on a wide variety of products. Whether you're a first-time user placing your first order or an existing customer looking to restock, these coupon codes guarantee substantial savings. Take advantage of discounts up to 90%, free shipping on select orders, and $100 off when you shop at Temu. Don’t wait—start shopping today and use the coupon codes [act892435] or [acq943609] to unlock the best possible deals! Happy shopping!
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.