Class GameTestHelper

java.lang.Object
net.minecraft.gametest.framework.GameTestHelper

public class GameTestHelper extends Object
  • Field Details

    • testInfo

      private final GameTestInfo testInfo
    • finalCheckAdded

      private boolean finalCheckAdded
  • Constructor Details

    • GameTestHelper

      public GameTestHelper(GameTestInfo p_127597_)
  • Method Details

    • getLevel

      public ServerLevel getLevel()
    • getBlockState

      public BlockState getBlockState(BlockPos p_177233_)
    • getBlockEntity

      @Nullable public BlockEntity getBlockEntity(BlockPos p_177348_)
    • killAllEntities

      public void killAllEntities()
    • killAllEntitiesOfClass

      public void killAllEntitiesOfClass(Class p_289538_)
    • spawnItem

      public ItemEntity spawnItem(Item p_177190_, float p_177191_, float p_177192_, float p_177193_)
    • spawnItem

      public ItemEntity spawnItem(Item p_251435_, BlockPos p_250287_)
    • spawn

      public <E extends Entity> E spawn(EntityType<E> p_177177_, BlockPos p_177178_)
    • spawn

      public <E extends Entity> E spawn(EntityType<E> p_177174_, Vec3 p_177175_)
    • spawn

      public <E extends Entity> E spawn(EntityType<E> p_177169_, int p_177170_, int p_177171_, int p_177172_)
    • spawn

      public <E extends Entity> E spawn(EntityType<E> p_177164_, float p_177165_, float p_177166_, float p_177167_)
    • spawnWithNoFreeWill

      public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177330_, BlockPos p_177331_)
    • spawnWithNoFreeWill

      public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177322_, int p_177323_, int p_177324_, int p_177325_)
    • spawnWithNoFreeWill

      public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177327_, Vec3 p_177328_)
    • spawnWithNoFreeWill

      public <E extends Mob> E spawnWithNoFreeWill(EntityType<E> p_177317_, float p_177318_, float p_177319_, float p_177320_)
    • walkTo

      public GameTestSequence walkTo(Mob p_177186_, BlockPos p_177187_, float p_177188_)
    • pressButton

      public void pressButton(int p_177104_, int p_177105_, int p_177106_)
    • pressButton

      public void pressButton(BlockPos p_177386_)
    • useBlock

      public void useBlock(BlockPos p_177409_)
    • useBlock

      public void useBlock(BlockPos p_250131_, Player p_251507_)
    • useBlock

      public void useBlock(BlockPos p_262023_, Player p_261901_, BlockHitResult p_262040_)
    • makeAboutToDrown

      public LivingEntity makeAboutToDrown(LivingEntity p_177184_)
    • makeMockSurvivalPlayer

      public Player makeMockSurvivalPlayer()
    • withLowHealth

      public LivingEntity withLowHealth(LivingEntity p_286794_)
    • makeMockPlayer

      public Player makeMockPlayer()
    • makeMockServerPlayerInLevel

      @Deprecated(forRemoval=true) public ServerPlayer makeMockServerPlayerInLevel()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • pullLever

      public void pullLever(int p_177303_, int p_177304_, int p_177305_)
    • pullLever

      public void pullLever(BlockPos p_177422_)
    • pulseRedstone

      public void pulseRedstone(BlockPos p_177235_, long p_177236_)
    • destroyBlock

      public void destroyBlock(BlockPos p_177435_)
    • setBlock

      public void setBlock(int p_177108_, int p_177109_, int p_177110_, Block p_177111_)
    • setBlock

      public void setBlock(int p_177113_, int p_177114_, int p_177115_, BlockState p_177116_)
    • setBlock

      public void setBlock(BlockPos p_177246_, Block p_177247_)
    • setBlock

      public void setBlock(BlockPos p_177253_, BlockState p_177254_)
    • setNight

      public void setNight()
    • setDayTime

      public void setDayTime(int p_177102_)
    • assertBlockPresent

      public void assertBlockPresent(Block p_177204_, int p_177205_, int p_177206_, int p_177207_)
    • assertBlockPresent

      public void assertBlockPresent(Block p_177209_, BlockPos p_177210_)
    • assertBlockNotPresent

      public void assertBlockNotPresent(Block p_177337_, int p_177338_, int p_177339_, int p_177340_)
    • assertBlockNotPresent

      public void assertBlockNotPresent(Block p_177342_, BlockPos p_177343_)
    • succeedWhenBlockPresent

      public void succeedWhenBlockPresent(Block p_177378_, int p_177379_, int p_177380_, int p_177381_)
    • succeedWhenBlockPresent

      public void succeedWhenBlockPresent(Block p_177383_, BlockPos p_177384_)
    • assertBlock

      public void assertBlock(BlockPos p_177272_, Predicate<Block> p_177273_, String p_177274_)
    • assertBlock

      public void assertBlock(BlockPos p_177276_, Predicate<Block> p_177277_, Supplier<String> p_177278_)
    • assertBlockProperty

      public <T extends Comparable<T>> void assertBlockProperty(BlockPos p_177256_, Property<T> p_177257_, T p_177258_)
    • assertBlockProperty

      public <T extends Comparable<T>> void assertBlockProperty(BlockPos p_177260_, Property<T> p_177261_, Predicate<T> p_177262_, String p_177263_)
    • assertBlockState

      public void assertBlockState(BlockPos p_177358_, Predicate<BlockState> p_177359_, Supplier<String> p_177360_)
    • assertRedstoneSignal

      public void assertRedstoneSignal(BlockPos p_289644_, Direction p_289642_, IntPredicate p_289645_, Supplier<String> p_289684_)
    • assertEntityPresent

      public void assertEntityPresent(EntityType<?> p_177157_)
    • assertEntityPresent

      public void assertEntityPresent(EntityType<?> p_177370_, int p_177371_, int p_177372_, int p_177373_)
    • assertEntityPresent

      public void assertEntityPresent(EntityType<?> p_177375_, BlockPos p_177376_)
    • assertEntityPresent

      public void assertEntityPresent(EntityType<?> p_252010_, Vec3 p_249488_, Vec3 p_251186_)
    • assertEntitiesPresent

      public void assertEntitiesPresent(EntityType<?> p_239372_, BlockPos p_239373_, int p_239374_, double p_239375_)
    • assertEntityPresent

      public void assertEntityPresent(EntityType<?> p_177180_, BlockPos p_177181_, double p_177182_)
    • getEntities

      public <T extends Entity> List<T> getEntities(EntityType<T> p_238400_, BlockPos p_238401_, double p_238402_)
    • assertEntityInstancePresent

      public void assertEntityInstancePresent(Entity p_177133_, int p_177134_, int p_177135_, int p_177136_)
    • assertEntityInstancePresent

      public void assertEntityInstancePresent(Entity p_177141_, BlockPos p_177142_)
    • assertItemEntityCountIs

      public void assertItemEntityCountIs(Item p_177199_, BlockPos p_177200_, double p_177201_, int p_177202_)
    • assertItemEntityPresent

      public void assertItemEntityPresent(Item p_177195_, BlockPos p_177196_, double p_177197_)
    • assertItemEntityNotPresent

      public void assertItemEntityNotPresent(Item p_236779_, BlockPos p_236780_, double p_236781_)
    • assertEntityNotPresent

      public void assertEntityNotPresent(EntityType<?> p_177310_)
    • assertEntityNotPresent

      public void assertEntityNotPresent(EntityType<?> p_177398_, int p_177399_, int p_177400_, int p_177401_)
    • assertEntityNotPresent

      public void assertEntityNotPresent(EntityType<?> p_177403_, BlockPos p_177404_)
    • assertEntityTouching

      public void assertEntityTouching(EntityType<?> p_177159_, double p_177160_, double p_177161_, double p_177162_)
    • assertEntityNotTouching

      public void assertEntityNotTouching(EntityType<?> p_177312_, double p_177313_, double p_177314_, double p_177315_)
    • assertEntityData

      public <E extends Entity, T> void assertEntityData(BlockPos p_177238_, EntityType<E> p_177239_, Function<? super E,T> p_177240_, @Nullable T p_177241_)
    • assertEntityIsHolding

      public <E extends LivingEntity> void assertEntityIsHolding(BlockPos p_263501_, EntityType<E> p_263510_, Item p_263517_)
    • assertEntityInventoryContains

      public <E extends Entity & InventoryCarrier> void assertEntityInventoryContains(BlockPos p_263495_, EntityType<E> p_263521_, Item p_263502_)
    • assertContainerEmpty

      public void assertContainerEmpty(BlockPos p_177441_)
    • assertContainerContains

      public void assertContainerContains(BlockPos p_177243_, Item p_177244_)
    • assertSameBlockStates

      public void assertSameBlockStates(BoundingBox p_177225_, BlockPos p_177226_)
    • assertSameBlockState

      public void assertSameBlockState(BlockPos p_177269_, BlockPos p_177270_)
    • assertAtTickTimeContainerContains

      public void assertAtTickTimeContainerContains(long p_177124_, BlockPos p_177125_, Item p_177126_)
    • assertAtTickTimeContainerEmpty

      public void assertAtTickTimeContainerEmpty(long p_177121_, BlockPos p_177122_)
    • succeedWhenEntityData

      public <E extends Entity, T> void succeedWhenEntityData(BlockPos p_177350_, EntityType<E> p_177351_, Function<E,T> p_177352_, T p_177353_)
    • assertEntityProperty

      public <E extends Entity> void assertEntityProperty(E p_177153_, Predicate<E> p_177154_, String p_177155_)
    • assertEntityProperty

      public <E extends Entity, T> void assertEntityProperty(E p_177148_, Function<E,T> p_177149_, String p_177150_, T p_177151_)
    • assertLivingEntityHasMobEffect

      public void assertLivingEntityHasMobEffect(LivingEntity p_296040_, MobEffect p_294360_, int p_294266_)
    • succeedWhenEntityPresent

      public void succeedWhenEntityPresent(EntityType<?> p_177414_, int p_177415_, int p_177416_, int p_177417_)
    • succeedWhenEntityPresent

      public void succeedWhenEntityPresent(EntityType<?> p_177419_, BlockPos p_177420_)
    • succeedWhenEntityNotPresent

      public void succeedWhenEntityNotPresent(EntityType<?> p_177427_, int p_177428_, int p_177429_, int p_177430_)
    • succeedWhenEntityNotPresent

      public void succeedWhenEntityNotPresent(EntityType<?> p_177432_, BlockPos p_177433_)
    • succeed

      public void succeed()
    • ensureSingleFinalCheck

      private void ensureSingleFinalCheck()
    • succeedIf

      public void succeedIf(Runnable p_177280_)
    • succeedWhen

      public void succeedWhen(Runnable p_177362_)
    • succeedOnTickWhen

      public void succeedOnTickWhen(int p_177118_, Runnable p_177119_)
    • runAtTickTime

      public void runAtTickTime(long p_177128_, Runnable p_177129_)
    • runAfterDelay

      public void runAfterDelay(long p_177307_, Runnable p_177308_)
    • randomTick

      public void randomTick(BlockPos p_177447_)
    • getHeight

      public int getHeight(Heightmap.Types p_236775_, int p_236776_, int p_236777_)
    • fail

      public void fail(String p_177290_, BlockPos p_177291_)
    • fail

      public void fail(String p_177287_, Entity p_177288_)
    • fail

      public void fail(String p_177285_)
    • failIf

      public void failIf(Runnable p_177393_)
    • failIfEver

      public void failIfEver(Runnable p_177411_)
    • startSequence

      public GameTestSequence startSequence()
    • absolutePos

      public BlockPos absolutePos(BlockPos p_177450_)
    • relativePos

      public BlockPos relativePos(BlockPos p_177453_)
    • absoluteVec

      public Vec3 absoluteVec(Vec3 p_177228_)
    • relativeVec

      public Vec3 relativeVec(Vec3 p_251543_)
    • assertTrue

      public void assertTrue(boolean p_249380_, String p_248720_)
    • assertFalse

      public void assertFalse(boolean p_277974_, String p_277933_)
    • getTick

      public long getTick()
    • getBounds

      private AABB getBounds()
    • getRelativeBounds

      private AABB getRelativeBounds()
    • forEveryBlockInStructure

      public void forEveryBlockInStructure(Consumer<BlockPos> p_177293_)
    • onEachTick

      public void onEachTick(Runnable p_177424_)
    • placeAt

      public void placeAt(Player p_261595_, ItemStack p_262007_, BlockPos p_261973_, Direction p_262008_)