Skip to content

Package net.minecraft.world.entity.ai.util

Part 1/1


AirAndWaterRandomPos

  • Full name: net.minecraft.world.entity.ai.util.AirAndWaterRandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/AirAndWaterRandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.AirAndWaterRandomPos#generateRandomPos(PathfinderMob,int,int,int,double,double,double,boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/AirAndWaterRandomPos.java:15
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

ดำเนินการ generateRandomPos ตาม implementation ของ AirAndWaterRandomPos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: generateRandomDirectionWithinRadians(), getRandom(), generateRandomPosTowardDirection(), isOutsideLimits(), isRestricted(), moveUpOutOfSolid(), level(), getMaxY(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • int k
  • double d
  • double e
  • double f
  • boolean bl

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos result = AirAndWaterRandomPos.generateRandomPos(pathfinderMob, 0, 0, 0, 0.0D, 0.0D, 0.0D, true);

net.minecraft.world.entity.ai.util.AirAndWaterRandomPos#getPos(PathfinderMob,int,int,int,double,double,double)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/AirAndWaterRandomPos.java:9
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos

ทำงานยังไง

เรียกต่อ: mobRestricted(), generateRandomPos(). คืนค่า: RandomPos.generateRandomPos(pathfinderMob, () -> generateRandomPos(pathfinderMob, i, j, k, d, e, f, bl)).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • int k
  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 result = AirAndWaterRandomPos.getPos(pathfinderMob, 0, 0, 0, 0.0D, 0.0D, 0.0D);

AirRandomPos

  • Full name: net.minecraft.world.entity.ai.util.AirRandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/AirRandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.AirRandomPos#getPosTowards(PathfinderMob,int,int,int,Vec3,double)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/AirRandomPos.java:9
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos Towards

ทำงานยังไง

เรียกต่อ: subtract(), getX(), getY(), getZ(), mobRestricted(), generateRandomPos(), isWater(). คืนค่า: blockPos != null && !GoalUtils.isWater(pathfinderMob, blockPos) ? blockPos : null.

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • int k
  • Vec3 vec3
  • double d

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 vec3 = ...;
Vec3 result = AirRandomPos.getPosTowards(pathfinderMob, 0, 0, 0, vec3, 0.0D);

DefaultRandomPos

  • Full name: net.minecraft.world.entity.ai.util.DefaultRandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/DefaultRandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.DefaultRandomPos#getPos(PathfinderMob,int,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/DefaultRandomPos.java:9
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos

ทำงานยังไง

เรียกต่อ: mobRestricted(), generateRandomPos(), generateRandomDirection(), getRandom(), generateRandomPosTowardDirection(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 result = DefaultRandomPos.getPos(pathfinderMob, 0, 0);

net.minecraft.world.entity.ai.util.DefaultRandomPos#getPosAway(PathfinderMob,int,int,Vec3)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/DefaultRandomPos.java:28
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos Away

ทำงานยังไง

เรียกต่อ: position(), subtract(), mobRestricted(), generateRandomPos(), generateRandomDirectionWithinRadians(), getRandom(), generateRandomPosTowardDirection(). คืนค่า: blockPos == null ? null : generateRandomPosTowardDirection(pathfinderMob, i, bl, blockPos).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • Vec3 vec3

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 vec3 = ...;
Vec3 result = DefaultRandomPos.getPosAway(pathfinderMob, 0, 0, vec3);

net.minecraft.world.entity.ai.util.DefaultRandomPos#getPosTowards(PathfinderMob,int,int,Vec3,double)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/DefaultRandomPos.java:18
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos Towards

ทำงานยังไง

เรียกต่อ: subtract(), getX(), getY(), getZ(), mobRestricted(), generateRandomPos(), generateRandomDirectionWithinRadians(), getRandom(). คืนค่า: blockPos == null ? null : generateRandomPosTowardDirection(pathfinderMob, i, bl, blockPos).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • Vec3 vec3
  • double d

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 vec3 = ...;
Vec3 result = DefaultRandomPos.getPosTowards(pathfinderMob, 0, 0, vec3, 0.0D);

GoalUtils

  • Full name: net.minecraft.world.entity.ai.util.GoalUtils
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/GoalUtils.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.GoalUtils#hasGroundPathNavigation(Mob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:12
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Ground Path Navigation

ทำงานยังไง

เรียกต่อ: getNavigation(). คืนค่า: mob.getNavigation() instanceof GroundPathNavigation.

Parameters

  • Mob mob

ตัวอย่างใช้งาน

Mob mob = ...;
boolean result = GoalUtils.hasGroundPathNavigation(mob);

net.minecraft.world.entity.ai.util.GoalUtils#hasMalus(PathfinderMob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:37
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Malus

ทำงานยังไง

เรียกต่อ: getPathfindingMalus(), getPathTypeStatic(). คืนค่า: pathfinderMob.getPathfindingMalus(WalkNodeEvaluator.getPathTypeStatic(pathfinderMob, blockPos)) != 0.0F.

Parameters

  • PathfinderMob pathfinderMob
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
boolean result = GoalUtils.hasMalus(pathfinderMob, blockPos);

net.minecraft.world.entity.ai.util.GoalUtils#isNotStable(PathNavigation,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:29
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Not Stable

ทำงานยังไง

เรียกต่อ: isStableDestination(). คืนค่า: !pathNavigation.isStableDestination(blockPos).

Parameters

  • PathNavigation pathNavigation
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathNavigation pathNavigation = ...;
BlockPos blockPos = ...;
boolean result = GoalUtils.isNotStable(pathNavigation, blockPos);

net.minecraft.world.entity.ai.util.GoalUtils#isOutsideLimits(BlockPos,PathfinderMob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:21
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Outside Limits

ทำงานยังไง

เรียกต่อ: level(), isOutsideBuildHeight(), getY(). คืนค่า: pathfinderMob.level().isOutsideBuildHeight(blockPos.getY()).

Parameters

  • BlockPos blockPos
  • PathfinderMob pathfinderMob

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
PathfinderMob pathfinderMob = ...;
boolean result = GoalUtils.isOutsideLimits(blockPos, pathfinderMob);

net.minecraft.world.entity.ai.util.GoalUtils#isRestricted(boolean,PathfinderMob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:25
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Restricted

ทำงานยังไง

เรียกต่อ: isWithinRestriction(). คืนค่า: bl && !pathfinderMob.isWithinRestriction(blockPos).

Parameters

  • boolean bl
  • PathfinderMob pathfinderMob
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
boolean result = GoalUtils.isRestricted(true, pathfinderMob, blockPos);

net.minecraft.world.entity.ai.util.GoalUtils#isSolid(PathfinderMob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:41
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Solid

ทำงานยังไง

เรียกต่อ: level(), getBlockState(). คืนค่า: pathfinderMob.level().getBlockState(blockPos).isSolid().

Parameters

  • PathfinderMob pathfinderMob
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
boolean result = GoalUtils.isSolid(pathfinderMob, blockPos);

net.minecraft.world.entity.ai.util.GoalUtils#isWater(PathfinderMob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:33
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Water

ทำงานยังไง

เรียกต่อ: level(), getFluidState(), is(). คืนค่า: pathfinderMob.level().getFluidState(blockPos).is(FluidTags.WATER).

Parameters

  • PathfinderMob pathfinderMob
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
boolean result = GoalUtils.isWater(pathfinderMob, blockPos);

net.minecraft.world.entity.ai.util.GoalUtils#mobRestricted(PathfinderMob,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/GoalUtils.java:16
  • Modifiers: public static
  • Return: boolean

คืออะไร

ดำเนินการ mobRestricted ตาม implementation ของ GoalUtils

ทำงานยังไง

เรียกต่อ: hasRestriction(), getRestrictCenter(), closerToCenterThan(), position(), getRestrictRadius(). คืนค่า: pathfinderMob.hasRestriction() && pathfinderMob.getRestrictCenter().closerToCenterThan(pathfinderMob.position(), pathfinderMob.getRestrictRadius() + i + 1.0).

Parameters

  • PathfinderMob pathfinderMob
  • int i

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
boolean result = GoalUtils.mobRestricted(pathfinderMob, 0);

HoverRandomPos

  • Full name: net.minecraft.world.entity.ai.util.HoverRandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/HoverRandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.HoverRandomPos#getPos(PathfinderMob,int,int,double,double,float,int,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/HoverRandomPos.java:9
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: mobRestricted(), generateRandomPos(), generateRandomDirectionWithinRadians(), getRandom(), generateRandomPosTowardDirection(), moveUpToAboveSolid(), nextInt(), level(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • double d
  • double e
  • float f
  • int k
  • int l

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 result = HoverRandomPos.getPos(pathfinderMob, 0, 0, 0.0D, 0.0D, 0.0F, 0, 0);

LandRandomPos

  • Full name: net.minecraft.world.entity.ai.util.LandRandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/LandRandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.LandRandomPos#generateRandomPosTowardDirection(PathfinderMob,int,boolean,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:58
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

ดำเนินการ generateRandomPosTowardDirection ตาม implementation ของ LandRandomPos

ทำงานยังไง

เรียกต่อ: getRandom(), isOutsideLimits(), isRestricted(), isNotStable(), getNavigation().

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • boolean bl
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
BlockPos result = LandRandomPos.generateRandomPosTowardDirection(pathfinderMob, 0, true, blockPos);

net.minecraft.world.entity.ai.util.LandRandomPos#getPos(PathfinderMob,int,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:10
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos

ทำงานยังไง

คืนค่า: getPos(pathfinderMob, i, j, pathfinderMob::getWalkTargetValue).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 result = LandRandomPos.getPos(pathfinderMob, 0, 0);

net.minecraft.world.entity.ai.util.LandRandomPos#getPos(PathfinderMob,int,int,ToDoubleFunction<BlockPos>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:15
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos

ทำงานยังไง

เรียกต่อ: mobRestricted(), generateRandomPos(), generateRandomDirection(), getRandom(), generateRandomPosTowardDirection(), movePosUpOutOfSolid(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • ToDoubleFunction<BlockPos> toDoubleFunction

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
ToDoubleFunction<BlockPos> toDoubleFunction = ...;
Vec3 result = LandRandomPos.getPos(pathfinderMob, 0, 0, toDoubleFunction);

net.minecraft.world.entity.ai.util.LandRandomPos#getPosAway(PathfinderMob,int,int,Vec3)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:32
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos Away

ทำงานยังไง

เรียกต่อ: position(), subtract(), mobRestricted(), getPosInDirection(). คืนค่า: getPosInDirection(pathfinderMob, i, j, vec32, bl).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • Vec3 vec3

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 vec3 = ...;
Vec3 result = LandRandomPos.getPosAway(pathfinderMob, 0, 0, vec3);

net.minecraft.world.entity.ai.util.LandRandomPos#getPosTowards(PathfinderMob,int,int,Vec3)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:25
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Pos Towards

ทำงานยังไง

เรียกต่อ: subtract(), getX(), getY(), getZ(), mobRestricted(), getPosInDirection(). คืนค่า: getPosInDirection(pathfinderMob, i, j, vec32, bl).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • int j
  • Vec3 vec3

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Vec3 vec3 = ...;
Vec3 result = LandRandomPos.getPosTowards(pathfinderMob, 0, 0, vec3);

net.minecraft.world.entity.ai.util.LandRandomPos#movePosUpOutOfSolid(PathfinderMob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/LandRandomPos.java:52
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

เคลื่อนที่ Pos Up Out Of Solid

ทำงานยังไง

เรียกต่อ: moveUpOutOfSolid(), level(), getMaxY(), isSolid(), isWater(), hasMalus(). คืนค่า: !GoalUtils.isWater(pathfinderMob, blockPos) && !GoalUtils.hasMalus(pathfinderMob, blockPos) ? blockPos : null.

Parameters

  • PathfinderMob pathfinderMob
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
BlockPos blockPos = ...;
BlockPos result = LandRandomPos.movePosUpOutOfSolid(pathfinderMob, blockPos);

RandomPos

  • Full name: net.minecraft.world.entity.ai.util.RandomPos
  • Package: net.minecraft.world.entity.ai.util
  • Source: commonnet/minecraft/world/entity/ai/util/RandomPos.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.ai.util.RandomPos#generateRandomDirection(RandomSource,int,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:18
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

ดำเนินการ generateRandomDirection ตาม implementation ของ RandomPos

ทำงานยังไง

เรียกต่อ: nextInt(). สร้างออบเจ็กต์: BlockPos. คืนค่า: new BlockPos(k, l, m).

Parameters

  • RandomSource randomSource
  • int i
  • int j

ตัวอย่างใช้งาน

RandomSource randomSource = ...;
BlockPos result = RandomPos.generateRandomDirection(randomSource, 0, 0);

net.minecraft.world.entity.ai.util.RandomPos#generateRandomDirectionWithinRadians(RandomSource,int,int,int,double,double,double)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:25
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

ดำเนินการ generateRandomDirectionWithinRadians ตาม implementation ของ RandomPos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: atan2(), nextFloat(), sqrt(), nextDouble(), sin(), cos(), abs(), nextInt(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • RandomSource randomSource
  • int i
  • int j
  • int k
  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

RandomSource randomSource = ...;
BlockPos result = RandomPos.generateRandomDirectionWithinRadians(randomSource, 0, 0, 0, 0.0D, 0.0D, 0.0D);

net.minecraft.world.entity.ai.util.RandomPos#generateRandomPos(PathfinderMob,Supplier<BlockPos>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:84
  • Modifiers: public static
  • Return: Vec3

คืออะไร

ดำเนินการ generateRandomPos ตาม implementation ของ RandomPos

ทำงานยังไง

คืนค่า: generateRandomPos(supplier, pathfinderMob::getWalkTargetValue).

Parameters

  • PathfinderMob pathfinderMob
  • Supplier<BlockPos> supplier

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
Supplier<BlockPos> supplier = ...;
Vec3 result = RandomPos.generateRandomPos(pathfinderMob, supplier);

net.minecraft.world.entity.ai.util.RandomPos#generateRandomPos(Supplier<BlockPos>,ToDoubleFunction<BlockPos>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:89
  • Modifiers: public static
  • Return: Vec3

คืออะไร

ดำเนินการ generateRandomPos ตาม implementation ของ RandomPos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: get(), applyAsDouble(), atBottomCenterOf(). คืนค่า: blockPos != null ? Vec3.atBottomCenterOf(blockPos) : null.

Parameters

  • Supplier<BlockPos> supplier
  • ToDoubleFunction<BlockPos> toDoubleFunction

ตัวอย่างใช้งาน

Supplier<BlockPos> supplier = ...;
ToDoubleFunction<BlockPos> toDoubleFunction = ...;
Vec3 result = RandomPos.generateRandomPos(supplier, toDoubleFunction);

net.minecraft.world.entity.ai.util.RandomPos#generateRandomPosTowardDirection(PathfinderMob,int,RandomSource,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:108
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

ดำเนินการ generateRandomPosTowardDirection ตาม implementation ของ RandomPos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getX(), getZ(), hasRestriction(), getRestrictCenter(), nextInt(), containing(), getY(). คืนค่า: BlockPos.containing(j + pathfinderMob.getX(), blockPos.getY() + pathfinderMob.getY(), k + pathfinderMob.getZ()).

Parameters

  • PathfinderMob pathfinderMob
  • int i
  • RandomSource randomSource
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfinderMob pathfinderMob = ...;
RandomSource randomSource = ...;
BlockPos blockPos = ...;
BlockPos result = RandomPos.generateRandomPosTowardDirection(pathfinderMob, 0, randomSource, blockPos);

net.minecraft.world.entity.ai.util.RandomPos#moveUpOutOfSolid(BlockPos,int,Predicate<BlockPos>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:40
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

เคลื่อนที่ Up Out Of Solid

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: test(), mutable(), move(), getY(), immutable(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockPos blockPos
  • int i
  • Predicate<BlockPos> predicate

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
Predicate<BlockPos> predicate = ...;
BlockPos result = RandomPos.moveUpOutOfSolid(blockPos, 0, predicate);

net.minecraft.world.entity.ai.util.RandomPos#moveUpToAboveSolid(BlockPos,int,int,Predicate<BlockPos>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/util/RandomPos.java:55
  • Modifiers: public static
  • Return: BlockPos

คืออะไร

เคลื่อนที่ Up To Above Solid

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: test(), mutable(), move(), getY(), immutable(). สร้างออบเจ็กต์: IllegalArgumentException. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockPos blockPos
  • int i
  • int j
  • Predicate<BlockPos> predicate

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
Predicate<BlockPos> predicate = ...;
BlockPos result = RandomPos.moveUpToAboveSolid(blockPos, 0, 0, predicate);