Class Raid

java.lang.Object
net.minecraft.world.entity.raid.Raid

public class Raid extends Object
  • Field Details

    • SECTION_RADIUS_FOR_FINDING_NEW_VILLAGE_CENTER

      private static final int SECTION_RADIUS_FOR_FINDING_NEW_VILLAGE_CENTER
      See Also:
    • ATTEMPT_RAID_FARTHEST

      private static final int ATTEMPT_RAID_FARTHEST
      See Also:
    • ATTEMPT_RAID_CLOSE

      private static final int ATTEMPT_RAID_CLOSE
      See Also:
    • ATTEMPT_RAID_INSIDE

      private static final int ATTEMPT_RAID_INSIDE
      See Also:
    • VILLAGE_SEARCH_RADIUS

      private static final int VILLAGE_SEARCH_RADIUS
      See Also:
    • RAID_TIMEOUT_TICKS

      private static final int RAID_TIMEOUT_TICKS
      See Also:
    • NUM_SPAWN_ATTEMPTS

      private static final int NUM_SPAWN_ATTEMPTS
      See Also:
    • OMINOUS_BANNER_PATTERN_NAME

      private static final String OMINOUS_BANNER_PATTERN_NAME
      See Also:
    • RAIDERS_REMAINING

      private static final String RAIDERS_REMAINING
      See Also:
    • VILLAGE_RADIUS_BUFFER

      public static final int VILLAGE_RADIUS_BUFFER
      See Also:
    • POST_RAID_TICK_LIMIT

      private static final int POST_RAID_TICK_LIMIT
      See Also:
    • DEFAULT_PRE_RAID_TICKS

      private static final int DEFAULT_PRE_RAID_TICKS
      See Also:
    • MAX_NO_ACTION_TIME

      public static final int MAX_NO_ACTION_TIME
      See Also:
    • MAX_CELEBRATION_TICKS

      public static final int MAX_CELEBRATION_TICKS
      See Also:
    • OUTSIDE_RAID_BOUNDS_TIMEOUT

      private static final int OUTSIDE_RAID_BOUNDS_TIMEOUT
      See Also:
    • TICKS_PER_DAY

      public static final int TICKS_PER_DAY
      See Also:
    • DEFAULT_MAX_BAD_OMEN_LEVEL

      public static final int DEFAULT_MAX_BAD_OMEN_LEVEL
      See Also:
    • LOW_MOB_THRESHOLD

      private static final int LOW_MOB_THRESHOLD
      See Also:
    • RAID_NAME_COMPONENT

      private static final Component RAID_NAME_COMPONENT
    • RAID_BAR_VICTORY_COMPONENT

      private static final Component RAID_BAR_VICTORY_COMPONENT
    • RAID_BAR_DEFEAT_COMPONENT

      private static final Component RAID_BAR_DEFEAT_COMPONENT
    • HERO_OF_THE_VILLAGE_DURATION

      private static final int HERO_OF_THE_VILLAGE_DURATION
      See Also:
    • VALID_RAID_RADIUS_SQR

      public static final int VALID_RAID_RADIUS_SQR
      See Also:
    • RAID_REMOVAL_THRESHOLD_SQR

      public static final int RAID_REMOVAL_THRESHOLD_SQR
      See Also:
    • groupToLeaderMap

      private final Map<Integer,Raider> groupToLeaderMap
    • groupRaiderMap

      private final Map<Integer,Set<Raider>> groupRaiderMap
    • heroesOfTheVillage

      private final Set<UUID> heroesOfTheVillage
    • ticksActive

      private long ticksActive
    • center

      private BlockPos center
    • level

      private final ServerLevel level
    • started

      private boolean started
    • id

      private final int id
    • totalHealth

      private float totalHealth
    • badOmenLevel

      private int badOmenLevel
    • active

      private boolean active
    • groupsSpawned

      private int groupsSpawned
    • raidEvent

      private final ServerBossEvent raidEvent
    • postRaidTicks

      private int postRaidTicks
    • raidCooldownTicks

      private int raidCooldownTicks
    • random

      private final RandomSource random
    • numGroups

      private final int numGroups
    • status

      private Raid.RaidStatus status
    • celebrationTicks

      private int celebrationTicks
    • waveSpawnPos

      private Optional<BlockPos> waveSpawnPos
  • Constructor Details

  • Method Details

    • isOver

      public boolean isOver()
    • isBetweenWaves

      public boolean isBetweenWaves()
    • hasFirstWaveSpawned

      public boolean hasFirstWaveSpawned()
    • isStopped

      public boolean isStopped()
    • isVictory

      public boolean isVictory()
    • isLoss

      public boolean isLoss()
    • getTotalHealth

      public float getTotalHealth()
    • getAllRaiders

      public Set<Raider> getAllRaiders()
    • getLevel

      public Level getLevel()
    • isStarted

      public boolean isStarted()
    • getGroupsSpawned

      public int getGroupsSpawned()
    • validPlayer

      private Predicate<ServerPlayer> validPlayer()
    • updatePlayers

      private void updatePlayers()
    • getMaxBadOmenLevel

      public int getMaxBadOmenLevel()
    • getBadOmenLevel

      public int getBadOmenLevel()
    • setBadOmenLevel

      public void setBadOmenLevel(int p_150219_)
    • absorbBadOmen

      public void absorbBadOmen(Player p_37729_)
    • stop

      public void stop()
    • tick

      public void tick()
    • moveRaidCenterToNearbyVillageSection

      private void moveRaidCenterToNearbyVillageSection()
    • getValidSpawnPos

      private Optional<BlockPos> getValidSpawnPos(int p_37764_)
    • hasMoreWaves

      private boolean hasMoreWaves()
    • isFinalWave

      private boolean isFinalWave()
    • hasBonusWave

      private boolean hasBonusWave()
    • hasSpawnedBonusWave

      private boolean hasSpawnedBonusWave()
    • shouldSpawnBonusGroup

      private boolean shouldSpawnBonusGroup()
    • updateRaiders

      private void updateRaiders()
    • playSound

      private void playSound(BlockPos p_37744_)
    • spawnGroup

      private void spawnGroup(BlockPos p_37756_)
    • joinRaid

      public void joinRaid(int p_37714_, Raider p_37715_, @Nullable BlockPos p_37716_, boolean p_37717_)
    • updateBossbar

      public void updateBossbar()
    • getHealthOfLivingRaiders

      public float getHealthOfLivingRaiders()
    • shouldSpawnGroup

      private boolean shouldSpawnGroup()
    • getTotalRaidersAlive

      public int getTotalRaidersAlive()
    • removeFromRaid

      public void removeFromRaid(Raider p_37741_, boolean p_37742_)
    • setDirty

      private void setDirty()
    • getLeaderBannerInstance

      public static ItemStack getLeaderBannerInstance()
    • getLeader

      @Nullable public Raider getLeader(int p_37751_)
    • findRandomSpawnPos

      @Nullable private BlockPos findRandomSpawnPos(int p_37708_, int p_37709_)
    • addWaveMob

      private boolean addWaveMob(int p_37753_, Raider p_37754_)
    • addWaveMob

      public boolean addWaveMob(int p_37719_, Raider p_37720_, boolean p_37721_)
    • setLeader

      public void setLeader(int p_37711_, Raider p_37712_)
    • removeLeader

      public void removeLeader(int p_37759_)
    • getCenter

      public BlockPos getCenter()
    • setCenter

      private void setCenter(BlockPos p_37761_)
    • getId

      public int getId()
    • getDefaultNumSpawns

      private int getDefaultNumSpawns(Raid.RaiderType p_37731_, int p_37732_, boolean p_37733_)
    • getPotentialBonusSpawns

      private int getPotentialBonusSpawns(Raid.RaiderType p_219829_, RandomSource p_219830_, int p_219831_, DifficultyInstance p_219832_, boolean p_219833_)
    • isActive

      public boolean isActive()
    • save

      public CompoundTag save(CompoundTag p_37748_)
    • getNumGroups

      public int getNumGroups(Difficulty p_37725_)
    • getEnchantOdds

      public float getEnchantOdds()
    • addHeroOfTheVillage

      public void addHeroOfTheVillage(Entity p_37727_)