Class EntityMixin

java.lang.Object
dev.latvian.mods.kubejs.core.mixin.EntityMixin
All Implemented Interfaces:
EntityKJS, MessageSenderKJS, WithPersistentData, ScriptTypeHolder

@RemapPrefixForJS("kjs$") public abstract class EntityMixin extends Object implements EntityKJS
  • Field Details

    • tickCount

      @RemapForJS("tickCount") public int tickCount
  • Constructor Details

    • EntityMixin

      public EntityMixin()
  • Method Details

    • playerTouch

      public abstract void playerTouch(net.minecraft.world.entity.player.Player arg)
    • kjs$getPersistentData

      public net.minecraft.nbt.CompoundTag kjs$getPersistentData()
      Specified by:
      kjs$getPersistentData in interface WithPersistentData
    • getPersistentData

      @RemapForJS("getForgePersistentData") public abstract net.minecraft.nbt.CompoundTag getPersistentData()
    • kjs$getRawPersistentData

      @Nullable @HideFromJS public @Nullable net.minecraft.nbt.CompoundTag kjs$getRawPersistentData()
      Specified by:
      kjs$getRawPersistentData in interface EntityKJS
    • kjs$setRawPersistentData

      @HideFromJS public void kjs$setRawPersistentData(@Nullable @Nullable net.minecraft.nbt.CompoundTag tag)
      Specified by:
      kjs$setRawPersistentData in interface EntityKJS
    • getUUID

      @RemapForJS("getUuid") public abstract UUID getUUID()
    • getStringUUID

      @RemapForJS("getStringUuid") public abstract String getStringUUID()
    • isCurrentlyGlowing

      @RemapForJS("isGlowing") public abstract boolean isCurrentlyGlowing()
    • setGlowingTag

      @RemapForJS("setGlowing") public abstract void setGlowingTag(boolean glowing)
    • getYRot

      @RemapForJS("getYaw") public abstract float getYRot()
    • setYRot

      @RemapForJS("setYaw") public abstract void setYRot(float yaw)
    • getXRot

      @RemapForJS("getPitch") public abstract float getXRot()
    • setXRot

      @RemapForJS("setPitch") public abstract void setXRot(float pitch)
    • setYBodyRot

      @RemapForJS("setBodyYaw") @Info("Sets the entity\'s body yaw.") public abstract void setYBodyRot(float yBodyRot)
    • getVisualRotationYInDegrees

      @RemapForJS("getBodyYaw") @Info("Gets the entity\'s body yaw (if the entity is a `LivingEntity`), or the entity\'s visual rotation (if the entity is an item entity or an item frame).") public abstract float getVisualRotationYInDegrees()
    • setDeltaMovement

      @RemapForJS("setMotion") public abstract void setDeltaMovement(double x, double y, double z)
    • moveTo

      @RemapForJS("setPositionAndRotation") public abstract void moveTo(double x, double y, double z, float yaw, float pitch)
    • push

      @RemapForJS("addMotion") public abstract void push(double x, double y, double z)
    • getPassengers

      @HideFromJS public abstract List<net.minecraft.world.entity.Entity> getPassengers()
    • isAlliedTo

      @RemapForJS("isOnSameTeam") public abstract boolean isAlliedTo(net.minecraft.world.entity.Entity e)
    • getDirection

      @RemapForJS("getHorizontalFacing") public abstract net.minecraft.core.Direction getDirection()
      KubeJS adds EntityKJS.kjs$getFacing() which also can specify whether the entity is looking down or up.
    • extinguishFire

      @RemapForJS("extinguish") public abstract void extinguishFire()
    • hurt

      @HideFromJS public abstract boolean hurt(net.minecraft.world.damagesource.DamageSource source, float hp)
      Replaced by
    • getType

      @RemapForJS("getEntityType") public abstract net.minecraft.world.entity.EntityType<?> getType()
      EntityKJS.kjs$getType() returns a string in JS.
    • distanceToSqr

      @Info("Measures the **square** of a distance of entity to the point at specified 3D position vector.") public abstract double distanceToSqr(net.minecraft.world.phys.Vec3 vec)
    • distanceToSqr

      @Info("Measures the distance of entity to the point at specified `x`, `y` and `z`.") public abstract double distanceToSqr(double x, double y, double z)
    • distanceToSqr

      @RemapForJS("distanceToEntitySqr") @Info("Measures the **square** of a distance of entity to another entity.") public abstract double distanceToSqr(net.minecraft.world.entity.Entity arg)
    • distanceTo

      @RemapForJS("distanceToEntity") @Info("Measures the distance of entity to another entity.") public abstract float distanceTo(net.minecraft.world.entity.Entity arg)
    • teleportTo

      @HideFromJS public abstract void teleportTo(double x, double y, double z)
    • teleportTo

      @HideFromJS public abstract boolean teleportTo(net.minecraft.server.level.ServerLevel level, double x, double y, double z, Set<net.minecraft.world.entity.RelativeMovement> relativeMovements, float yaw, float pitch)
    • level

      @HideFromJS public abstract net.minecraft.world.level.Level level()
      Replaced in JS by EntityKJS.kjs$getLevel().
    • spawnAtLocation

      @HideFromJS public abstract net.minecraft.world.entity.item.ItemEntity spawnAtLocation(net.minecraft.world.level.ItemLike item)
      Disambiguates Entity.spawnAtLocation(ItemStack) in JS.
    • spawnAtLocation

      @HideFromJS public abstract net.minecraft.world.entity.item.ItemEntity spawnAtLocation(net.minecraft.world.level.ItemLike item, int offsetY)
      Disambiguates Entity.spawnAtLocation(ItemStack, float) in JS.
    • moveTo

      @RemapForJS("moveToBlockPos") public abstract void moveTo(net.minecraft.core.BlockPos pos, float yRot, float xRot)
      Disambiguates Entity.moveTo(Vec3, float, float) in JS.