Class EntityBroom

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.entity.Entity>
net.minecraft.world.entity.Entity
org.cyclops.evilcraft.entity.item.EntityBroom
All Implemented Interfaces:
net.minecraft.commands.CommandSource, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.Nameable, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.entity.Entity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public class EntityBroom extends net.minecraft.world.entity.Entity
Entity for a broom
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity

    net.minecraft.world.entity.Entity.MoveFunction, net.minecraft.world.entity.Entity.MovementEmission, net.minecraft.world.entity.Entity.RemovalReason

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.world.entity.LivingEntity
    The player that last mounted this broom (used to detect dismounting)
    static final float
    Maximum angle of the broom between the XZ-plane and the Y-axis (in degrees, -90 = completely up, +90 = completely down) This limits the angle under which the player can move up or down
    static final float
    Minimum angle of the broom between the XZ-plane and the Y-axis (in degrees, -90 = completely up, +90 = completely down) This limits the angle under which the player can move up or down
    static final double
    Speed for the broom (in all directions)

    Fields inherited from class net.minecraft.world.entity.Entity

    BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, level, MAX_ENTITY_TAG_COUNT, maxUpStep, minorHorizontalCollision, moveDist, noCulling, noPhysics, onGround, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld

    Fields inherited from interface net.minecraft.commands.CommandSource

    NULL
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityBroom(net.minecraft.world.entity.EntityType<? extends EntityBroom> type, net.minecraft.world.level.Level world)
     
    EntityBroom(net.minecraft.world.entity.EntityType<? extends EntityBroom> type, net.minecraft.world.level.Level world, double x, double y, double z)
     
    EntityBroom(net.minecraft.world.level.Level world, double x, double y, double z)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addAdditionalSaveData(net.minecraft.nbt.CompoundTag nbttagcompound)
     
    protected void
    addPassenger(net.minecraft.world.entity.Entity passenger)
     
    protected boolean
    canAddPassenger(net.minecraft.world.entity.Entity passenger)
     
    boolean
    canBeRiddenInWater(net.minecraft.world.entity.Entity rider)
     
    boolean
    canConsume(int amount, net.minecraft.world.entity.LivingEntity entityLiving)
     
    boolean
    causeFallDamage(float distance, float damageMultiplier, net.minecraft.world.damagesource.DamageSource damageSource)
     
    protected void
     
    void
    consume(int amount, net.minecraft.world.entity.LivingEntity entityLiving)
     
    protected void
     
    net.minecraft.network.protocol.Packet<?>
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.entity.Entity
     
    net.minecraft.world.entity.EntityDimensions
    getDimensions(net.minecraft.world.entity.Pose poseIn)
     
    protected double
     
    double
     
    float
     
     
    double
     
    boolean
    hurt(net.minecraft.world.damagesource.DamageSource source, float amount)
     
    protected void
     
    net.minecraft.world.InteractionResult
    interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
     
    boolean
     
    void
    lerpTo(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean isTeleport)
     
    void
    load(net.minecraft.nbt.CompoundTag tagCompound)
     
    void
    push(net.minecraft.world.entity.Entity entityIn)
     
    protected void
    readAdditionalSaveData(net.minecraft.nbt.CompoundTag nbttagcompound)
     
    protected void
    removePassenger(net.minecraft.world.entity.Entity passenger)
     
    net.minecraft.nbt.CompoundTag
    saveWithoutId(net.minecraft.nbt.CompoundTag tag)
     
    void
    setBroomStack(net.minecraft.world.item.ItemStack itemStack)
     
    void
    setLastPlayerSpeed(double lastPlayerSpeed)
     
    void
     
    void
    startAllowFlying(net.minecraft.world.entity.LivingEntity entity)
     
    void
    stopAllowFlying(net.minecraft.world.entity.LivingEntity entity)
     
    void
     
    protected void
     
    protected void
    Called on the server side for all players or on the client side when the player mounted on the broom is the local player, so movement is as smooth as possible.
    protected void
     

    Methods inherited from class net.minecraft.world.entity.Entity

    absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addTag, animateHurt, awardKillScore, baseTick, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canFreeze, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, changeDimension, checkDespawn, checkFallDamage, checkInsideBlocks, checkOutOfWorld, chunkPosition, clearFire, closerThan, collideBoundingBox, copyPosition, createCommandSourceStack, createHoverEvent, discard, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, eyeBlockPosition, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, gameEvent, gameEvent, gameEvent, gameEvent, getAirSupply, getAllSlots, getArmorSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockSpeedFactor, getBlockStateOn, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForCulling, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getForward, getGameEventListenerRegistrar, getHandHoldingItemAngle, getHandSlots, getId, getIndirectPassengers, getLeashOffset, getLevel, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMotionDirection, getMovementEmission, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRelativePortalPosition, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSlot, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getViewYRot, getX, getX, getXRot, getY, getY, getYHeadRot, getYRot, getZ, getZ, handleEntityEvent, handleInsidePortal, handleNetherPortal, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlive, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCurrentlyGlowing, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWall, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushable, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, isVisuallySwimming, kill, killed, lavaHurt, lerpHeadTo, lerpMotion, limitPistonMovement, lookAt, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, occludesVibrations, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, outOfWorld, pick, playEntityOnFireExtinguishedSound, playerTouch, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, recreateFromPacket, refreshDimensions, remove, removeAfterChangingDimensions, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rideableUnderWater, rideTick, rotate, save, saveAsPassenger, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setItemSlot, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSprinting, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYBodyRot, setYHeadRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, shouldShowName, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopRiding, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.commands.CommandSource

    alwaysAccepts

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability, getCapability

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity

    canRiderInteract, deserializeNBT, getClassification, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
  • Field Details

    • SPEED

      public static final double SPEED
      Speed for the broom (in all directions)
      See Also:
    • MAX_ANGLE

      public static final float MAX_ANGLE
      Maximum angle of the broom between the XZ-plane and the Y-axis (in degrees, -90 = completely up, +90 = completely down) This limits the angle under which the player can move up or down
      See Also:
    • MIN_ANGLE

      public static final float MIN_ANGLE
      Minimum angle of the broom between the XZ-plane and the Y-axis (in degrees, -90 = completely up, +90 = completely down) This limits the angle under which the player can move up or down
      See Also:
    • lastMounted

      public net.minecraft.world.entity.LivingEntity lastMounted
      The player that last mounted this broom (used to detect dismounting)
  • Constructor Details

    • EntityBroom

      public EntityBroom(net.minecraft.world.entity.EntityType<? extends EntityBroom> type, net.minecraft.world.level.Level world)
    • EntityBroom

      public EntityBroom(net.minecraft.world.entity.EntityType<? extends EntityBroom> type, net.minecraft.world.level.Level world, double x, double y, double z)
    • EntityBroom

      public EntityBroom(net.minecraft.world.level.Level world, double x, double y, double z)
  • Method Details

    • getAddEntityPacket

      @Nonnull public net.minecraft.network.protocol.Packet<?> getAddEntityPacket()
      Specified by:
      getAddEntityPacket in class net.minecraft.world.entity.Entity
    • getDimensions

      public net.minecraft.world.entity.EntityDimensions getDimensions(net.minecraft.world.entity.Pose poseIn)
      Overrides:
      getDimensions in class net.minecraft.world.entity.Entity
    • initBroomHoverTickOffset

      protected void initBroomHoverTickOffset()
    • getPassengersRidingOffset

      public double getPassengersRidingOffset()
      Overrides:
      getPassengersRidingOffset in class net.minecraft.world.entity.Entity
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class net.minecraft.world.entity.Entity
    • interact

      public net.minecraft.world.InteractionResult interact(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand)
      Overrides:
      interact in class net.minecraft.world.entity.Entity
    • push

      public void push(net.minecraft.world.entity.Entity entityIn)
      Overrides:
      push in class net.minecraft.world.entity.Entity
    • lerpTo

      public void lerpTo(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean isTeleport)
      Overrides:
      lerpTo in class net.minecraft.world.entity.Entity
    • getControllingPassenger

      public net.minecraft.world.entity.Entity getControllingPassenger()
      Overrides:
      getControllingPassenger in class net.minecraft.world.entity.Entity
    • hurt

      public boolean hurt(net.minecraft.world.damagesource.DamageSource source, float amount)
      Overrides:
      hurt in class net.minecraft.world.entity.Entity
    • startAllowFlying

      public void startAllowFlying(net.minecraft.world.entity.LivingEntity entity)
    • stopAllowFlying

      public void stopAllowFlying(net.minecraft.world.entity.LivingEntity entity)
    • addPassenger

      protected void addPassenger(net.minecraft.world.entity.Entity passenger)
      Overrides:
      addPassenger in class net.minecraft.world.entity.Entity
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.world.entity.Entity
    • canAddPassenger

      protected boolean canAddPassenger(net.minecraft.world.entity.Entity passenger)
      Overrides:
      canAddPassenger in class net.minecraft.world.entity.Entity
    • removePassenger

      protected void removePassenger(net.minecraft.world.entity.Entity passenger)
      Overrides:
      removePassenger in class net.minecraft.world.entity.Entity
    • showParticles

      public void showParticles(EntityBroom broom)
    • collideWithNearbyEntities

      protected void collideWithNearbyEntities()
    • updateMountedClient

      protected void updateMountedClient()
    • canConsume

      public boolean canConsume(int amount, net.minecraft.world.entity.LivingEntity entityLiving)
    • consume

      public void consume(int amount, net.minecraft.world.entity.LivingEntity entityLiving)
    • updateMountedServer

      protected void updateMountedServer()
      Called on the server side for all players or on the client side when the player mounted on the broom is the local player, so movement is as smooth as possible.
    • getLastPlayerSpeed

      public double getLastPlayerSpeed()
    • setLastPlayerSpeed

      public void setLastPlayerSpeed(double lastPlayerSpeed)
    • updateUnmounted

      protected void updateUnmounted()
    • getHoverOffset

      protected double getHoverOffset()
    • causeFallDamage

      public boolean causeFallDamage(float distance, float damageMultiplier, net.minecraft.world.damagesource.DamageSource damageSource)
      Overrides:
      causeFallDamage in class net.minecraft.world.entity.Entity
    • canBeRiddenInWater

      public boolean canBeRiddenInWater(net.minecraft.world.entity.Entity rider)
    • defineSynchedData

      protected void defineSynchedData()
      Specified by:
      defineSynchedData in class net.minecraft.world.entity.Entity
    • readAdditionalSaveData

      protected void readAdditionalSaveData(net.minecraft.nbt.CompoundTag nbttagcompound)
      Specified by:
      readAdditionalSaveData in class net.minecraft.world.entity.Entity
    • addAdditionalSaveData

      protected void addAdditionalSaveData(net.minecraft.nbt.CompoundTag nbttagcompound)
      Specified by:
      addAdditionalSaveData in class net.minecraft.world.entity.Entity
    • setBroomStack

      public void setBroomStack(net.minecraft.world.item.ItemStack itemStack)
    • getBroomStack

      public net.minecraft.world.item.ItemStack getBroomStack()
    • getModifiers

      public Map<BroomModifier,Float> getModifiers()
    • getModifier

      public float getModifier(BroomModifier modifier)
    • saveWithoutId

      public net.minecraft.nbt.CompoundTag saveWithoutId(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveWithoutId in class net.minecraft.world.entity.Entity
    • load

      public void load(net.minecraft.nbt.CompoundTag tagCompound)
      Overrides:
      load in class net.minecraft.world.entity.Entity