Class AbstractStatueBlockEntity<T extends SoldierEntity>

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
tech.anonymoushacker1279.immersiveweapons.blockentity.AbstractStatueBlockEntity<T>
All Implemented Interfaces:
net.minecraft.world.level.block.EntityBlock, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
MedicStatueBlockEntity, MinutemanStatueBlockEntity

public abstract class AbstractStatueBlockEntity<T extends SoldierEntity> extends net.minecraft.world.level.block.entity.BlockEntity implements net.minecraft.world.level.block.EntityBlock
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected float
     
    protected static final net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>
     
    protected int
     
    protected float
     
    protected final int
     

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractStatueBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, int maxNearbyEntities)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected abstract T
    createEntity(net.minecraft.world.level.Level level)
     
    protected @Nullable List<? extends net.minecraft.world.entity.LivingEntity>
    getEntitiesInArea(T entityClass)
     
    protected net.minecraft.core.BlockPos
    Get a random position in the nearby area.
    void
    load(net.minecraft.nbt.CompoundTag nbt)
     
    protected void
    prepareEntitySpawn(net.minecraft.world.level.Level level)
     
    protected void
    saveAdditional(net.minecraft.nbt.CompoundTag pTag)
     
    protected void
     
    void
    tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos)
     

    Methods inherited from class net.minecraft.world.level.block.entity.BlockEntity

    addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, removeData, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setData, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    areAttachmentsCompatible, deserializeAttachments, getData, getExistingData, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.block.EntityBlock

    getListener, getTicker, newBlockEntity

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
  • Field Details

    • cooldown

      protected int cooldown
    • maxNearbyEntities

      protected final int maxNearbyEntities
    • additionalEntities

      protected int additionalEntities
    • armorSpawnChance

      protected float armorSpawnChance
    • gearEnchantChance

      protected float gearEnchantChance
    • BATTLEFIELD

      protected static final net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome> BATTLEFIELD
  • Constructor Details

    • AbstractStatueBlockEntity

      public AbstractStatueBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, int maxNearbyEntities)
  • Method Details

    • tick

      public void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos blockPos)
    • prepareEntitySpawn

      protected void prepareEntitySpawn(net.minecraft.world.level.Level level)
    • attemptSpawnEntity

      protected void attemptSpawnEntity(T entity)
    • spawnParticles

      protected void spawnParticles()
    • getRandomPositionInArea

      protected net.minecraft.core.BlockPos getRandomPositionInArea()
      Get a random position in the nearby area.
      Returns:
      BlockPos
    • getEntitiesInArea

      @Nullable protected @Nullable List<? extends net.minecraft.world.entity.LivingEntity> getEntitiesInArea(@Nullable T entityClass)
    • createEntity

      @Nullable protected abstract T createEntity(net.minecraft.world.level.Level level)
    • saveAdditional

      protected void saveAdditional(net.minecraft.nbt.CompoundTag pTag)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag nbt)
      Overrides:
      load in class net.minecraft.world.level.block.entity.BlockEntity