Skip to content

Package net.minecraft.world.entity.ai.sensing

Part 1/1


AdultSensor

  • Full name: net.minecraft.world.entity.ai.sensing.AdultSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/AdultSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<AgeableMob>

net.minecraft.world.entity.ai.sensing.AdultSensor#doTick(ServerLevel,AgeableMob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/AdultSensor.java:17
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ AdultSensor

ทำงานยังไง

เรียกต่อ: getBrain(), getMemory(), ifPresent(), setNearestVisibleAdult().

Parameters

  • ServerLevel serverLevel
  • AgeableMob ageableMob

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

ServerLevel serverLevel = ...;
AgeableMob ageableMob = ...;
@Override
protected void doTick(ServerLevel serverLevel, AgeableMob ageableMob) {
    super.doTick(serverLevel, ageableMob);
}

net.minecraft.world.entity.ai.sensing.AdultSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/AdultSensor.java:12
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ AdultSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_VISIBLE_ADULT, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES).

Parameters

  • ไม่มี

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

AdultSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

AxolotlAttackablesSensor

  • Full name: net.minecraft.world.entity.ai.sensing.AxolotlAttackablesSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/AxolotlAttackablesSensor.java
  • Type: class
  • Modifiers: public
  • Extends: NearestVisibleLivingEntitySensor

net.minecraft.world.entity.ai.sensing.AxolotlAttackablesSensor#getMemory()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/AxolotlAttackablesSensor.java:31
  • Modifiers: protected
  • Return: MemoryModuleType<LivingEntity>

คืออะไร

อ่านค่า Memory

ทำงานยังไง

คืนค่า: MemoryModuleType.NEAREST_ATTACKABLE.

Parameters

  • ไม่มี

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

@Override
protected MemoryModuleType<LivingEntity> getMemory() {
    return super.getMemory();
}

net.minecraft.world.entity.ai.sensing.AxolotlAttackablesSensor#isMatchingEntity(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/AxolotlAttackablesSensor.java:11
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Matching Entity

ทำงานยังไง

เรียกต่อ: isClose(), isInWaterOrBubble(), isHostileTarget(), isHuntTarget(), isEntityAttackable().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
@Override
protected boolean isMatchingEntity(ServerLevel serverLevel, LivingEntity livingEntity, LivingEntity livingEntity2) {
    return super.isMatchingEntity(serverLevel, livingEntity, livingEntity2);
}

BreezeAttackEntitySensor

  • Full name: net.minecraft.world.entity.ai.sensing.BreezeAttackEntitySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/BreezeAttackEntitySensor.java
  • Type: class
  • Modifiers: public
  • Extends: NearestLivingEntitySensor<Breeze>

net.minecraft.world.entity.ai.sensing.BreezeAttackEntitySensor#doTick(ServerLevel,Breeze)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/BreezeAttackEntitySensor.java:19
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ BreezeAttackEntitySensor

ทำงานยังไง

เรียกต่อ: getBrain(), getMemory(), stream(), flatMap(), filter(), isEntityAttackable(), findFirst(), ifPresentOrElse().

Parameters

  • ServerLevel serverLevel
  • Breeze breeze

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

ServerLevel serverLevel = ...;
Breeze breeze = ...;
@Override
protected void doTick(ServerLevel serverLevel, Breeze breeze) {
    super.doTick(serverLevel, breeze);
}

net.minecraft.world.entity.ai.sensing.BreezeAttackEntitySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/BreezeAttackEntitySensor.java:14
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ BreezeAttackEntitySensor

ทำงานยังไง

เรียกต่อ: copyOf(), concat(), of(). คืนค่า: ImmutableSet.copyOf(Iterables.concat(super.requires(), List.of(MemoryModuleType.NEAREST_ATTACKABLE))).

Parameters

  • ไม่มี

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

BreezeAttackEntitySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

DummySensor

  • Full name: net.minecraft.world.entity.ai.sensing.DummySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/DummySensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.DummySensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/DummySensor.java:10
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ DummySensor

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.DummySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/DummySensor.java:14
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ DummySensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of().

Parameters

  • ไม่มี

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

DummySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

FrogAttackablesSensor

  • Full name: net.minecraft.world.entity.ai.sensing.FrogAttackablesSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/FrogAttackablesSensor.java
  • Type: class
  • Modifiers: public
  • Extends: NearestVisibleLivingEntitySensor

net.minecraft.world.entity.ai.sensing.FrogAttackablesSensor#getMemory()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/FrogAttackablesSensor.java:29
  • Modifiers: protected
  • Return: MemoryModuleType<LivingEntity>

คืออะไร

อ่านค่า Memory

ทำงานยังไง

คืนค่า: MemoryModuleType.NEAREST_ATTACKABLE.

Parameters

  • ไม่มี

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

@Override
protected MemoryModuleType<LivingEntity> getMemory() {
    return super.getMemory();
}

net.minecraft.world.entity.ai.sensing.FrogAttackablesSensor#isMatchingEntity(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/FrogAttackablesSensor.java:14
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Matching Entity

ทำงานยังไง

เรียกต่อ: getBrain(), hasMemoryValue(), isEntityAttackable(), canEat(), isUnreachableAttackTarget(), closerThan().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
@Override
protected boolean isMatchingEntity(ServerLevel serverLevel, LivingEntity livingEntity, LivingEntity livingEntity2) {
    return super.isMatchingEntity(serverLevel, livingEntity, livingEntity2);
}

GolemSensor

  • Full name: net.minecraft.world.entity.ai.sensing.GolemSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/GolemSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.GolemSensor#checkForNearbyGolem(LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:34
  • Modifiers: public static
  • Return: void

คืออะไร

ตรวจสอบ For Nearby Golem

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBrain(), getMemory(), isEmpty(), get(), stream(), anyMatch(), getType(), equals().

Parameters

  • LivingEntity livingEntity

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

LivingEntity livingEntity = ...;
GolemSensor.checkForNearbyGolem(livingEntity);

net.minecraft.world.entity.ai.sensing.GolemSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:24
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ GolemSensor

ทำงานยังไง

เรียกต่อ: checkForNearbyGolem().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.GolemSensor#golemDetected(LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:44
  • Modifiers: public static
  • Return: void

คืออะไร

ดำเนินการ golemDetected ตาม implementation ของ GolemSensor

ทำงานยังไง

เรียกต่อ: getBrain(), setMemoryWithExpiry().

Parameters

  • LivingEntity livingEntity

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

LivingEntity livingEntity = ...;
GolemSensor.golemDetected(livingEntity);

net.minecraft.world.entity.ai.sensing.GolemSensor#GolemSensor()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:16
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ GolemSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ไม่มี

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

GolemSensor instance = new GolemSensor();

net.minecraft.world.entity.ai.sensing.GolemSensor#GolemSensor(int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:20
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ GolemSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • int i

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

GolemSensor instance = new GolemSensor(0);

net.minecraft.world.entity.ai.sensing.GolemSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/GolemSensor.java:29
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ GolemSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_LIVING_ENTITIES).

Parameters

  • ไม่มี

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

GolemSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

HoglinSpecificSensor

  • Full name: net.minecraft.world.entity.ai.sensing.HoglinSpecificSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<Hoglin>

net.minecraft.world.entity.ai.sensing.HoglinSpecificSensor#doTick(ServerLevel,Hoglin)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java:31
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ HoglinSpecificSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBrain(), setMemory(), findNearestRepellent(), empty(), newArrayList(), getMemory(), orElse(), findAll().

Parameters

  • ServerLevel serverLevel
  • Hoglin hoglin

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

ServerLevel serverLevel = ...;
Hoglin hoglin = ...;
@Override
protected void doTick(ServerLevel serverLevel, Hoglin hoglin) {
    super.doTick(serverLevel, hoglin);
}

net.minecraft.world.entity.ai.sensing.HoglinSpecificSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/HoglinSpecificSensor.java:19
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ HoglinSpecificSensor

ทำงานยังไง

เรียกต่อ: of().

Parameters

  • ไม่มี

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

HoglinSpecificSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

HurtBySensor

  • Full name: net.minecraft.world.entity.ai.sensing.HurtBySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/HurtBySensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.HurtBySensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/HurtBySensor.java:18
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ HurtBySensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBrain(), getLastDamageSource(), setMemory(), getEntity(), eraseMemory(), getMemory(), ifPresent(), isAlive().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.HurtBySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/HurtBySensor.java:13
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ HurtBySensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY).

Parameters

  • ไม่มี

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

HurtBySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

IsInWaterSensor

  • Full name: net.minecraft.world.entity.ai.sensing.IsInWaterSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/IsInWaterSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.IsInWaterSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/IsInWaterSensor.java:16
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ IsInWaterSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isInWater(), getBrain(), setMemory(), eraseMemory().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.IsInWaterSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/IsInWaterSensor.java:11
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ IsInWaterSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.IS_IN_WATER).

Parameters

  • ไม่มี

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

IsInWaterSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

MobSensor

  • Full name: net.minecraft.world.entity.ai.sensing.MobSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/MobSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<T>

net.minecraft.world.entity.ai.sensing.MobSensor#checkForMobsNearby(T)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:40
  • Modifiers: public
  • Return: void

คืออะไร

ตรวจสอบ For Mobs Nearby

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBrain(), getMemory(), isEmpty(), get(), stream(), anyMatch(), test(), mobDetected().

Parameters

  • T livingEntity

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

MobSensor instance = ...;
T livingEntity = ...;
instance.checkForMobsNearby(livingEntity);

net.minecraft.world.entity.ai.sensing.MobSensor#clearMemory(T)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:54
  • Modifiers: public
  • Return: void

คืออะไร

ล้าง Memory

ทำงานยังไง

เรียกต่อ: getBrain(), eraseMemory().

Parameters

  • T livingEntity

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

MobSensor instance = ...;
T livingEntity = ...;
instance.clearMemory(livingEntity);

net.minecraft.world.entity.ai.sensing.MobSensor#doTick(ServerLevel,T)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:26
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ MobSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: test(), clearMemory(), checkForMobsNearby().

Parameters

  • ServerLevel serverLevel
  • T livingEntity

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

ServerLevel serverLevel = ...;
T livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, T livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.MobSensor#mobDetected(T)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:50
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ mobDetected ตาม implementation ของ MobSensor

ทำงานยังไง

เรียกต่อ: getBrain(), setMemoryWithExpiry().

Parameters

  • T livingEntity

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

MobSensor instance = ...;
T livingEntity = ...;
instance.mobDetected(livingEntity);

net.minecraft.world.entity.ai.sensing.MobSensor#MobSensor(int,BiPredicate<T, LivingEntity>,Predicate<T>,MemoryModuleType<Boolean>,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:18
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ MobSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: mobTest, readyTest, toSet, memoryTimeToLive.

Parameters

  • int i
  • BiPredicate<T, LivingEntity> biPredicate
  • Predicate<T> predicate
  • MemoryModuleType<Boolean> memoryModuleType
  • int j

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

BiPredicate<T, LivingEntity> biPredicate = ...;
Predicate<T> predicate = ...;
MemoryModuleType<Boolean> memoryModuleType = ...;
MobSensor instance = new MobSensor(0, biPredicate, predicate, memoryModuleType, 0);

net.minecraft.world.entity.ai.sensing.MobSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/MobSensor.java:35
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ MobSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: Set.of(MemoryModuleType.NEAREST_LIVING_ENTITIES).

Parameters

  • ไม่มี

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

MobSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

NearestBedSensor

  • Full name: net.minecraft.world.entity.ai.sensing.NearestBedSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/NearestBedSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<Mob>

net.minecraft.world.entity.ai.sensing.NearestBedSensor#doTick(ServerLevel,Mob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestBedSensor.java:39
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ NearestBedSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: triedCount, lastUpdate. เรียกต่อ: isBaby(), getGameTime(), getRandom(), nextInt(), getPoiManager(), asLong(), containsKey(), put(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • ServerLevel serverLevel
  • Mob mob

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

ServerLevel serverLevel = ...;
Mob mob = ...;
@Override
protected void doTick(ServerLevel serverLevel, Mob mob) {
    super.doTick(serverLevel, mob);
}

net.minecraft.world.entity.ai.sensing.NearestBedSensor#NearestBedSensor()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestBedSensor.java:30
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ NearestBedSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ไม่มี

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

NearestBedSensor instance = new NearestBedSensor();

net.minecraft.world.entity.ai.sensing.NearestBedSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestBedSensor.java:34
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ NearestBedSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_BED).

Parameters

  • ไม่มี

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

NearestBedSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

NearestItemSensor

  • Full name: net.minecraft.world.entity.ai.sensing.NearestItemSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/NearestItemSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<Mob>

net.minecraft.world.entity.ai.sensing.NearestItemSensor#doTick(ServerLevel,Mob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestItemSensor.java:24
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ NearestItemSensor

ทำงานยังไง

เรียกต่อ: getBrain(), getEntitiesOfClass(), getBoundingBox(), inflate(), sort(), comparingDouble(), stream(), filter().

Parameters

  • ServerLevel serverLevel
  • Mob mob

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

ServerLevel serverLevel = ...;
Mob mob = ...;
@Override
protected void doTick(ServerLevel serverLevel, Mob mob) {
    super.doTick(serverLevel, mob);
}

net.minecraft.world.entity.ai.sensing.NearestItemSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestItemSensor.java:19
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ NearestItemSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM).

Parameters

  • ไม่มี

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

NearestItemSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

NearestLivingEntitySensor

  • Full name: net.minecraft.world.entity.ai.sensing.NearestLivingEntitySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<T>

net.minecraft.world.entity.ai.sensing.NearestLivingEntitySensor#doTick(ServerLevel,T)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java:16
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ NearestLivingEntitySensor

ทำงานยังไง

เรียกต่อ: getAttributeValue(), getBoundingBox(), inflate(), getEntitiesOfClass(), isAlive(), sort(), comparingDouble(), getBrain(). สร้างออบเจ็กต์: NearestVisibleLivingEntities.

Parameters

  • ServerLevel serverLevel
  • T livingEntity

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

ServerLevel serverLevel = ...;
T livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, T livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.NearestLivingEntitySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestLivingEntitySensor.java:27
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ NearestLivingEntitySensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES).

Parameters

  • ไม่มี

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

NearestLivingEntitySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

NearestVisibleLivingEntitySensor

  • Full name: net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java
  • Type: class
  • Modifiers: public abstract
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java:21
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ NearestVisibleLivingEntitySensor

ทำงานยังไง

เรียกต่อ: getBrain(), setMemory(), getMemory(), getNearestEntity().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor#getMemory()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java:14
  • Modifiers: protected abstract
  • Return: MemoryModuleType<LivingEntity>

คืออะไร

อ่านค่า Memory

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

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

@Override
protected MemoryModuleType<LivingEntity> getMemory() {
    return super.getMemory();
}

net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor#getVisibleEntities(LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java:33
  • Modifiers: protected
  • Return: Optional<NearestVisibleLivingEntities>

คืออะไร

อ่านค่า Visible Entities

ทำงานยังไง

เรียกต่อ: getBrain(), getMemory(). คืนค่า: livingEntity.getBrain().getMemory(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES).

Parameters

  • LivingEntity livingEntity

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

LivingEntity livingEntity = ...;
@Override
protected Optional<NearestVisibleLivingEntities> getVisibleEntities(LivingEntity livingEntity) {
    return super.getVisibleEntities(livingEntity);
}

net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor#isMatchingEntity(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java:12
  • Modifiers: protected abstract
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Matching Entity

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
@Override
protected boolean isMatchingEntity(ServerLevel serverLevel, LivingEntity livingEntity, LivingEntity livingEntity2) {
    return super.isMatchingEntity(serverLevel, livingEntity, livingEntity2);
}

net.minecraft.world.entity.ai.sensing.NearestVisibleLivingEntitySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor.java:16
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ NearestVisibleLivingEntitySensor

ทำงานยังไง

เรียกต่อ: of(), getMemory(). คืนค่า: ImmutableSet.of(this.getMemory()).

Parameters

  • ไม่มี

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

NearestVisibleLivingEntitySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

PiglinBruteSpecificSensor

  • Full name: net.minecraft.world.entity.ai.sensing.PiglinBruteSpecificSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/PiglinBruteSpecificSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.PiglinBruteSpecificSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PiglinBruteSpecificSensor.java:25
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ PiglinBruteSpecificSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBrain(), newArrayList(), getMemory(), orElse(), empty(), findClosest(), map(), of().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.PiglinBruteSpecificSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PiglinBruteSpecificSensor.java:20
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ PiglinBruteSpecificSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_NEMESIS, MemoryModuleType.NEARBY_ADULT_PIGLINS).

Parameters

  • ไม่มี

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

PiglinBruteSpecificSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

PiglinSpecificSensor

  • Full name: net.minecraft.world.entity.ai.sensing.PiglinSpecificSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.PiglinSpecificSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java:48
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ PiglinSpecificSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBrain(), setMemory(), findNearestRepellent(), empty(), newArrayList(), getMemory(), orElse(), findAll().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.PiglinSpecificSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PiglinSpecificSensor.java:30
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ PiglinSpecificSensor

ทำงานยังไง

เรียกต่อ: of().

Parameters

  • ไม่มี

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

PiglinSpecificSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

PlayerSensor

  • Full name: net.minecraft.world.entity.ai.sensing.PlayerSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/PlayerSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.PlayerSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PlayerSensor.java:23
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ PlayerSensor

ทำงานยังไง

เรียกต่อ: players(), stream(), filter(), closerThan(), getFollowDistance(), sorted(), comparingDouble(), collect().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.PlayerSensor#getFollowDistance(LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PlayerSensor.java:39
  • Modifiers: protected
  • Return: double

คืออะไร

อ่านค่า Follow Distance

ทำงานยังไง

เรียกต่อ: getAttributeValue(). คืนค่า: livingEntity.getAttributeValue(Attributes.FOLLOW_RANGE).

Parameters

  • LivingEntity livingEntity

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

LivingEntity livingEntity = ...;
@Override
protected double getFollowDistance(LivingEntity livingEntity) {
    return super.getFollowDistance(livingEntity);
}

net.minecraft.world.entity.ai.sensing.PlayerSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/PlayerSensor.java:18
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ PlayerSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER).

Parameters

  • ไม่มี

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

PlayerSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

SecondaryPoiSensor

  • Full name: net.minecraft.world.entity.ai.sensing.SecondaryPoiSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<Villager>

net.minecraft.world.entity.ai.sensing.SecondaryPoiSensor#doTick(ServerLevel,Villager)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java:23
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ SecondaryPoiSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: dimension(), blockPosition(), newArrayList(), offset(), getVillagerData(), getProfession(), secondaryPoi(), contains().

Parameters

  • ServerLevel serverLevel
  • Villager villager

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

ServerLevel serverLevel = ...;
Villager villager = ...;
@Override
protected void doTick(ServerLevel serverLevel, Villager villager) {
    super.doTick(serverLevel, villager);
}

net.minecraft.world.entity.ai.sensing.SecondaryPoiSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java:48
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ SecondaryPoiSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.SECONDARY_JOB_SITE).

Parameters

  • ไม่มี

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

SecondaryPoiSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

net.minecraft.world.entity.ai.sensing.SecondaryPoiSensor#SecondaryPoiSensor()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/SecondaryPoiSensor.java:19
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ SecondaryPoiSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ไม่มี

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

SecondaryPoiSensor instance = new SecondaryPoiSensor();

Sensing

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

net.minecraft.world.entity.ai.sensing.Sensing#hasLineOfSight(Entity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensing.java:24
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Line Of Sight

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getId(), contains(), get(), push(), pop(), add(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • Entity entity

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

Sensing instance = ...;
Entity entity = ...;
boolean result = instance.hasLineOfSight(entity);

net.minecraft.world.entity.ai.sensing.Sensing#Sensing(Mob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensing.java:15
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Sensing ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: mob.

Parameters

  • Mob mob

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

Mob mob = ...;
Sensing instance = new Sensing(mob);

net.minecraft.world.entity.ai.sensing.Sensing#tick()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensing.java:19
  • Modifiers: public
  • Return: void

คืออะไร

ประมวลผล tick tick

ทำงานยังไง

เรียกต่อ: clear().

Parameters

  • ไม่มี

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

Sensing instance = ...;
instance.tick();

Sensor

  • Full name: net.minecraft.world.entity.ai.sensing.Sensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/Sensor.java
  • Type: class
  • Modifiers: public abstract

net.minecraft.world.entity.ai.sensing.Sensor#doTick(ServerLevel,E)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:60
  • Modifiers: protected abstract
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ Sensor

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ServerLevel serverLevel
  • E livingEntity

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

ServerLevel serverLevel = ...;
E livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, E livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.Sensor#isEntityAttackable(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:70
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Entity Attackable

ทำงานยังไง

เรียกต่อ: getBrain(), isMemoryValue(), test().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = Sensor.isEntityAttackable(serverLevel, livingEntity, livingEntity2);

net.minecraft.world.entity.ai.sensing.Sensor#isEntityAttackableIgnoringLineOfSight(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:80
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Entity Attackable Ignoring Line Of Sight

ทำงานยังไง

เรียกต่อ: getBrain(), isMemoryValue(), test().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = Sensor.isEntityAttackableIgnoringLineOfSight(serverLevel, livingEntity, livingEntity2);

net.minecraft.world.entity.ai.sensing.Sensor#isEntityTargetable(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:64
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Entity Targetable

ทำงานยังไง

เรียกต่อ: getBrain(), isMemoryValue(), test().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = Sensor.isEntityTargetable(serverLevel, livingEntity, livingEntity2);

net.minecraft.world.entity.ai.sensing.Sensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:62
  • Modifiers: public abstract
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ Sensor

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

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

Sensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

net.minecraft.world.entity.ai.sensing.Sensor#Sensor()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:38
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Sensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • ไม่มี

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

Sensor instance = new Sensor();

net.minecraft.world.entity.ai.sensing.Sensor#Sensor(int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:33
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Sensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: scanRate, timeToTick. เรียกต่อ: nextInt().

Parameters

  • int i

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

Sensor instance = new Sensor(0);

net.minecraft.world.entity.ai.sensing.Sensor#tick(ServerLevel,E)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:42
  • Modifiers: public final
  • Return: void

คืออะไร

ประมวลผล tick tick

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: timeToTick. เรียกต่อ: updateTargetingConditionRanges(), doTick().

Parameters

  • ServerLevel serverLevel
  • E livingEntity

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

Sensor instance = ...;
ServerLevel serverLevel = ...;
E livingEntity = ...;
instance.tick(serverLevel, livingEntity);

net.minecraft.world.entity.ai.sensing.Sensor#wasEntityAttackableLastNTicks(LivingEntity,int)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/Sensor.java:76
  • Modifiers: public static
  • Return: BiPredicate<ServerLevel, LivingEntity>

คืออะไร

ดำเนินการ wasEntityAttackableLastNTicks ตาม implementation ของ Sensor

ทำงานยังไง

เรียกต่อ: rememberPositives(), isEntityAttackable(). คืนค่า: rememberPositives(i, (serverLevel, livingEntity2) -> isEntityAttackable(serverLevel, livingEntity, livingEntity2)).

Parameters

  • LivingEntity livingEntity
  • int i

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

LivingEntity livingEntity = ...;
BiPredicate<ServerLevel, LivingEntity> result = Sensor.wasEntityAttackableLastNTicks(livingEntity, 0);

SensorType

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

net.minecraft.world.entity.ai.sensing.SensorType#create()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/SensorType.java:58
  • Modifiers: public
  • Return: U

คืออะไร

สร้าง create

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.factory.get().

Parameters

  • ไม่มี

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

SensorType instance = ...;
U result = instance.create();

net.minecraft.world.entity.ai.sensing.SensorType#SensorType(Supplier<U>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/SensorType.java:54
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ SensorType ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: factory.

Parameters

  • Supplier<U> supplier

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

Supplier<U> supplier = ...;
SensorType instance = new SensorType(supplier);

TemptingSensor

  • Full name: net.minecraft.world.entity.ai.sensing.TemptingSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/TemptingSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<PathfinderMob>

net.minecraft.world.entity.ai.sensing.TemptingSensor#doTick(ServerLevel,PathfinderMob)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/TemptingSensor.java:27
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ TemptingSensor

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBrain(), copy(), range(), getAttributeValue(), players(), stream(), filter(), test().

Parameters

  • ServerLevel serverLevel
  • PathfinderMob pathfinderMob

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

ServerLevel serverLevel = ...;
PathfinderMob pathfinderMob = ...;
@Override
protected void doTick(ServerLevel serverLevel, PathfinderMob pathfinderMob) {
    super.doTick(serverLevel, pathfinderMob);
}

net.minecraft.world.entity.ai.sensing.TemptingSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/TemptingSensor.java:54
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ TemptingSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.TEMPTING_PLAYER).

Parameters

  • ไม่มี

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

TemptingSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

net.minecraft.world.entity.ai.sensing.TemptingSensor#TemptingSensor(Predicate<ItemStack>)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/TemptingSensor.java:23
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ TemptingSensor ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: temptations.

Parameters

  • Predicate<ItemStack> predicate

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

Predicate<ItemStack> predicate = ...;
TemptingSensor instance = new TemptingSensor(predicate);

VillagerBabiesSensor

  • Full name: net.minecraft.world.entity.ai.sensing.VillagerBabiesSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/VillagerBabiesSensor.java
  • Type: class
  • Modifiers: public
  • Extends: Sensor<LivingEntity>

net.minecraft.world.entity.ai.sensing.VillagerBabiesSensor#doTick(ServerLevel,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/VillagerBabiesSensor.java:19
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ VillagerBabiesSensor

ทำงานยังไง

เรียกต่อ: getBrain(), setMemory(), getNearestVillagerBabies().

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
@Override
protected void doTick(ServerLevel serverLevel, LivingEntity livingEntity) {
    super.doTick(serverLevel, livingEntity);
}

net.minecraft.world.entity.ai.sensing.VillagerBabiesSensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/VillagerBabiesSensor.java:14
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ VillagerBabiesSensor

ทำงานยังไง

เรียกต่อ: of(). คืนค่า: ImmutableSet.of(MemoryModuleType.VISIBLE_VILLAGER_BABIES).

Parameters

  • ไม่มี

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

VillagerBabiesSensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();

VillagerHostilesSensor

  • Full name: net.minecraft.world.entity.ai.sensing.VillagerHostilesSensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/VillagerHostilesSensor.java
  • Type: class
  • Modifiers: public
  • Extends: NearestVisibleLivingEntitySensor

net.minecraft.world.entity.ai.sensing.VillagerHostilesSensor#getMemory()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/VillagerHostilesSensor.java:34
  • Modifiers: protected
  • Return: MemoryModuleType<LivingEntity>

คืออะไร

อ่านค่า Memory

ทำงานยังไง

คืนค่า: MemoryModuleType.NEAREST_HOSTILE.

Parameters

  • ไม่มี

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

@Override
protected MemoryModuleType<LivingEntity> getMemory() {
    return super.getMemory();
}

net.minecraft.world.entity.ai.sensing.VillagerHostilesSensor#isMatchingEntity(ServerLevel,LivingEntity,LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/VillagerHostilesSensor.java:24
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Matching Entity

ทำงานยังไง

เรียกต่อ: isHostile(), isClose(). คืนค่า: this.isHostile(livingEntity2) && this.isClose(livingEntity, livingEntity2).

Parameters

  • ServerLevel serverLevel
  • LivingEntity livingEntity
  • LivingEntity livingEntity2

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

ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
@Override
protected boolean isMatchingEntity(ServerLevel serverLevel, LivingEntity livingEntity, LivingEntity livingEntity2) {
    return super.isMatchingEntity(serverLevel, livingEntity, livingEntity2);
}

WardenEntitySensor

  • Full name: net.minecraft.world.entity.ai.sensing.WardenEntitySensor
  • Package: net.minecraft.world.entity.ai.sensing
  • Source: commonnet/minecraft/world/entity/ai/sensing/WardenEntitySensor.java
  • Type: class
  • Modifiers: public
  • Extends: NearestLivingEntitySensor<Warden>

net.minecraft.world.entity.ai.sensing.WardenEntitySensor#doTick(ServerLevel,Warden)

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/WardenEntitySensor.java:22
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ doTick ตาม implementation ของ WardenEntitySensor

ทำงานยังไง

เรียกต่อ: getClosest(), getType(), or(), ifPresentOrElse(), getBrain(), setMemory(), eraseMemory().

Parameters

  • ServerLevel serverLevel
  • Warden warden

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

ServerLevel serverLevel = ...;
Warden warden = ...;
@Override
protected void doTick(ServerLevel serverLevel, Warden warden) {
    super.doTick(serverLevel, warden);
}

net.minecraft.world.entity.ai.sensing.WardenEntitySensor#requires()

  • Origin: common
  • Source: net/minecraft/world/entity/ai/sensing/WardenEntitySensor.java:17
  • Modifiers: public
  • Return: Set<MemoryModuleType<?>>

คืออะไร

ดำเนินการ requires ตาม implementation ของ WardenEntitySensor

ทำงานยังไง

เรียกต่อ: copyOf(), concat(), of(). คืนค่า: ImmutableSet.copyOf(Iterables.concat(super.requires(), List.of(MemoryModuleType.NEAREST_ATTACKABLE))).

Parameters

  • ไม่มี

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

WardenEntitySensor instance = ...;
Set<MemoryModuleType<?>> result = instance.requires();