Class ExtendedGameTestHelper
java.lang.Object
net.minecraft.gametest.framework.GameTestHelper
net.neoforged.testframework.gametest.ExtendedGameTestHelper
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
Fields inherited from class net.minecraft.gametest.framework.GameTestHelper
testInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEndListener
(Consumer<Boolean> listener) <T extends net.neoforged.bus.api.Event>
voidaddTemporaryListener
(Consumer<T> event) void
assertContainerContains
(int x, int y, int z, Item item) void
assertContainerEmpty
(int x, int y, int z) <T,
E extends Entity>
voidassertEntityProperty
(E entity, Function<E, T> function, String valueName, T expected, BiPredicate<T, T> tester) void
assertItemEntityCountIsAtLeast
(Item item, BlockPos pos, double range, int lowerLimit) <E extends LivingEntity>
voidassertMobEffectAbsent
(E entity, MobEffect effect, String testName) <E extends LivingEntity>
voidassertMobEffectPresent
(E entity, MobEffect effect, String testName) void
assertPlayerHasItem
(Player player, Item item) blocksBetween
(int x, int y, int z, int length, int height, int width) void
void
void
boneMealUntilGrown
(int x, int y, int z, Player player) To be used alongsideGameTestSequence.thenWaitUntil(Runnable)
void
<T> T
catchException
(ExtendedGameTestHelper.ThrowingSupplier<T> supplier) <T extends BlockEntity>
TgetBlockEntity
(int x, int y, int z, Class<T> type) <T extends BlockEntity>
TgetBlockEntity
(BlockPos pos, Class<T> type) void
killAllEntitiesOfClass
(Class<?>... types) <T extends Entity>
TknockbackResistant
(T entity) makeOpMockPlayer
(int commandLevel) makeTickingMockServerPlayerInCorner
(GameType gameType) makeTickingMockServerPlayerInLevel
(GameType gameType) void
pulseRedstone
(int x, int y, int z, long delay) <T extends BlockEntity>
TrequireBlockEntity
(int x, int y, int z, Class<T> type) <T extends BlockEntity>
TrequireBlockEntity
(BlockPos pos, Class<T> type) void
requireDifficulty
(Difficulty difficulty) <T extends Entity>
TrequireEntityAt
(EntityType<T> type, int x, int y, int z) <T extends Entity>
TrequireEntityAt
(EntityType<T> type, BlockPos pos) <T> ParametrizedGameTestSequence<T>
startSequence
(Supplier<T> value) void
void
void
Methods inherited from class net.minecraft.gametest.framework.GameTestHelper
absolutePos, absoluteVec, assertAtTickTimeContainerContains, assertAtTickTimeContainerEmpty, assertBlock, assertBlock, assertBlockNotPresent, assertBlockNotPresent, assertBlockPresent, assertBlockPresent, assertBlockProperty, assertBlockProperty, assertBlockState, assertContainerContains, assertContainerEmpty, assertEntitiesPresent, assertEntitiesPresent, assertEntityData, assertEntityInstancePresent, assertEntityInstancePresent, assertEntityInventoryContains, assertEntityIsHolding, assertEntityNotPresent, assertEntityNotPresent, assertEntityNotPresent, assertEntityNotTouching, assertEntityPresent, assertEntityPresent, assertEntityPresent, assertEntityPresent, assertEntityPresent, assertEntityProperty, assertEntityProperty, assertEntityTouching, assertFalse, assertItemEntityCountIs, assertItemEntityNotPresent, assertItemEntityNotPresent, assertItemEntityPresent, assertItemEntityPresent, assertLivingEntityHasMobEffect, assertRedstoneSignal, assertSameBlockState, assertSameBlockStates, assertTrue, destroyBlock, fail, fail, fail, failIf, failIfEver, forEveryBlockInStructure, getBlockEntity, getBlockState, getBounds, getEntities, getHeight, getLevel, getTick, killAllEntities, killAllEntitiesOfClass, makeAboutToDrown, makeMockPlayer, makeMockServerPlayerInLevel, makeMockSurvivalPlayer, onEachTick, placeAt, pressButton, pressButton, pullLever, pullLever, pulseRedstone, randomTick, relativePos, relativeVec, runAfterDelay, runAtTickTime, setBiome, setBlock, setBlock, setBlock, setBlock, setDayTime, setNight, spawn, spawn, spawn, spawn, spawnItem, spawnItem, spawnWithNoFreeWill, spawnWithNoFreeWill, spawnWithNoFreeWill, spawnWithNoFreeWill, succeed, succeedIf, succeedOnTickWhen, succeedWhen, succeedWhenBlockPresent, succeedWhenBlockPresent, succeedWhenEntityData, succeedWhenEntityNotPresent, succeedWhenEntityNotPresent, succeedWhenEntityPresent, succeedWhenEntityPresent, tickPrecipitation, tickPrecipitation, useBlock, useBlock, useBlock, walkTo, withLowHealth
-
Constructor Details
-
ExtendedGameTestHelper
-
-
Method Details
-
startSequence
- Overrides:
startSequence
in classGameTestHelper
-
useOn
-
useBlock
-
useBlock
-
assertEntityProperty
public <T,E extends Entity> void assertEntityProperty(E entity, Function<E, T> function, String valueName, T expected, BiPredicate<T, T> tester) -
makeTickingMockServerPlayerInCorner
-
makeTickingMockServerPlayerInLevel
-
makeOpMockPlayer
-
blocksBetween
-
getBlockEntity
-
getBlockEntity
-
requireBlockEntity
-
requireBlockEntity
-
startSequence
-
killAllEntitiesOfClass
-
assertItemEntityCountIsAtLeast
-
boneMeal
-
boneMeal
-
boneMealUntilGrown
To be used alongsideGameTestSequence.thenWaitUntil(Runnable)
-
assertContainerEmpty
public void assertContainerEmpty(int x, int y, int z) -
assertContainerContains
-
pulseRedstone
public void pulseRedstone(int x, int y, int z, long delay) -
assertPlayerHasItem
-
requireDifficulty
-
addEndListener
-
catchException
-
catchException
-
requireEntityAt
-
requireEntityAt
-
knockbackResistant
-
addTemporaryListener
-
assertMobEffectPresent
public <E extends LivingEntity> void assertMobEffectPresent(E entity, MobEffect effect, String testName) -
assertMobEffectAbsent
public <E extends LivingEntity> void assertMobEffectAbsent(E entity, MobEffect effect, String testName)
-