Package net.minecraft.world.entity.ai.goal.target
Part 1/1
DefendVillageTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.DefendVillageTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java - Type:
class - Modifiers:
public - Extends:
TargetGoal
net.minecraft.world.entity.ai.goal.target.DefendVillageTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java:27 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: potentialTarget. เรียกต่อ: getBoundingBox(), inflate(), getServerLevel(), getNearbyEntities(), getNearbyPlayers(), getPlayerReputation(), isSpectator(), isCreative().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.DefendVillageTargetGoal#DefendVillageTargetGoal(IronGolem)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java:21 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DefendVillageTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: golem. เรียกต่อ: setFlags(), of().
Parameters
IronGolem ironGolem
ตัวอย่างใช้งาน
IronGolem ironGolem = ...;
DefendVillageTargetGoal instance = new DefendVillageTargetGoal(ironGolem);
net.minecraft.world.entity.ai.goal.target.DefendVillageTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java:50 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
เรียกต่อ: setTarget().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
HurtByTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java - Type:
class - Modifiers:
public - Extends:
TargetGoal
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#alertOther(Mob,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:114 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ alertOther ตาม implementation ของ HurtByTargetGoal
ทำงานยังไง
เรียกต่อ: setTarget().
Parameters
Mob mobLivingEntity livingEntity
ตัวอย่างใช้งาน
Mob mob = ...;
LivingEntity livingEntity = ...;
@Override
protected void alertOther(Mob mob, LivingEntity livingEntity) {
super.alertOther(mob, livingEntity);
}
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#alertOthers()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:73 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ alertOthers ตาม implementation ของ HurtByTargetGoal
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: toIgnoreAlert. เรียกต่อ: getFollowDistance(), unitCubeFromLowerCorner(), position(), inflate(), level(), getEntitiesOfClass(), getClass(), iterator().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:33 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getLastHurtByMobTimestamp(), getLastHurtByMob(), getType(), getServerLevel(), getGameRules(), getBoolean(), isAssignableFrom(), getClass(). มีจุด return อย่างน้อย 4 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#HurtByTargetGoal(PathfinderMob,Class<?>[])
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:27 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ HurtByTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: toIgnoreDamage. เรียกต่อ: setFlags(), of().
Parameters
PathfinderMob pathfinderMobClass<?>[] classs
ตัวอย่างใช้งาน
PathfinderMob pathfinderMob = ...;
Class<?>[] classs = ...;
HurtByTargetGoal instance = new HurtByTargetGoal(pathfinderMob, classs);
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#setAlertOthers(Class<?>[])
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:54 - Modifiers:
public - Return:
HurtByTargetGoal
คืออะไร
กำหนดค่า Alert Others
ทำงานยังไง
แก้ state: alertSameType, toIgnoreAlert. คืนค่า: this.
Parameters
Class<?>[] classs
ตัวอย่างใช้งาน
HurtByTargetGoal instance = ...;
Class<?>[] classs = ...;
HurtByTargetGoal result = instance.setAlertOthers(classs);
net.minecraft.world.entity.ai.goal.target.HurtByTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java:60 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: targetMob, timestamp, unseenMemoryTicks. เรียกต่อ: setTarget(), getLastHurtByMob(), getTarget(), getLastHurtByMobTimestamp(), alertOthers().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
NearestAttackableTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java - Type:
class - Modifiers:
public - Extends:
TargetGoal
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:42 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getRandom(), nextInt(), findTarget(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#findTarget()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:56 - Modifiers:
protected - Return:
void
คืออะไร
ค้นหา Target
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: target. เรียกต่อ: getServerLevel(), getNearestEntity(), level(), getEntitiesOfClass(), getTargetSearchArea(), getFollowDistance(), getTargetConditions(), getX().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#getTargetSearchArea(double)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:52 - Modifiers:
protected - Return:
AABB
คืออะไร
อ่านค่า Target Search Area
ทำงานยังไง
เรียกต่อ: getBoundingBox(), inflate(). คืนค่า: this.mob.getBoundingBox().inflate(d, d, d).
Parameters
double d
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#NearestAttackableTargetGoal(Mob,Class<T>,boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestAttackableTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Mob mobClass<T> class_boolean bl
ตัวอย่างใช้งาน
Mob mob = ...;
Class<T> class_ = ...;
NearestAttackableTargetGoal instance = new NearestAttackableTargetGoal(mob, class_, true);
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#NearestAttackableTargetGoal(Mob,Class<T>,boolean,boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:30 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestAttackableTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Mob mobClass<T> class_boolean blboolean bl2
ตัวอย่างใช้งาน
Mob mob = ...;
Class<T> class_ = ...;
NearestAttackableTargetGoal instance = new NearestAttackableTargetGoal(mob, class_, true, true);
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#NearestAttackableTargetGoal(Mob,Class<T>,boolean,TargetingConditions.Selector)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:26 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestAttackableTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Mob mobClass<T> class_boolean blTargetingConditions.Selector selector
ตัวอย่างใช้งาน
Mob mob = ...;
Class<T> class_ = ...;
TargetingConditions.Selector selector = ...;
NearestAttackableTargetGoal instance = new NearestAttackableTargetGoal(mob, class_, true, selector);
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#NearestAttackableTargetGoal(Mob,Class<T>,int,boolean,boolean,TargetingConditions.Selector)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:34 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestAttackableTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: targetType, randomInterval, targetConditions. เรียกต่อ: reducedTickDelay(), setFlags(), of(), forCombat(), range(), getFollowDistance(), selector().
Parameters
Mob mobClass<T> class_int iboolean blboolean bl2TargetingConditions.Selector selector
ตัวอย่างใช้งาน
Mob mob = ...;
Class<T> class_ = ...;
TargetingConditions.Selector selector = ...;
NearestAttackableTargetGoal instance = new NearestAttackableTargetGoal(mob, class_, 0, true, true, selector);
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#setTarget(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:78 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Target
ทำงานยังไง
แก้ state: target.
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
NearestAttackableTargetGoal instance = ...;
LivingEntity livingEntity = ...;
instance.setTarget(livingEntity);
net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java:72 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
เรียกต่อ: setTarget().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
NearestAttackableWitchTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.NearestAttackableWitchTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/NearestAttackableWitchTargetGoal.java - Type:
class - Modifiers:
public - Extends:
NearestAttackableTargetGoal<T>
net.minecraft.world.entity.ai.goal.target.NearestAttackableWitchTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableWitchTargetGoal.java:19 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
คืนค่า: this.canAttack && super.canUse().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestAttackableWitchTargetGoal#NearestAttackableWitchTargetGoal(Raider,Class<T>,int,boolean,boolean,TargetingConditions.Selector)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableWitchTargetGoal.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestAttackableWitchTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Raider raiderClass<T> class_int iboolean blboolean bl2TargetingConditions.Selector selector
ตัวอย่างใช้งาน
Raider raider = ...;
Class<T> class_ = ...;
TargetingConditions.Selector selector = ...;
NearestAttackableWitchTargetGoal instance = new NearestAttackableWitchTargetGoal(raider, class_, 0, true, true, selector);
net.minecraft.world.entity.ai.goal.target.NearestAttackableWitchTargetGoal#setCanAttack(boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestAttackableWitchTargetGoal.java:15 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Can Attack
ทำงานยังไง
แก้ state: canAttack.
Parameters
boolean bl
ตัวอย่างใช้งาน
NearestHealableRaiderTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java - Type:
class - Modifiers:
public - Extends:
NearestAttackableTargetGoal<T>
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java:24 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getRandom(), nextBoolean(), hasActiveRaid(), findTarget(). มีจุด return อย่างน้อย 3 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal#decrementCooldown()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java:20 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ decrementCooldown ตาม implementation ของ NearestHealableRaiderTargetGoal
ทำงานยังไง
แก้ state: cooldown.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal#getCooldown()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java:16 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Cooldown
ทำงานยังไง
คืนค่า: this.cooldown.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal#NearestHealableRaiderTargetGoal(Raider,Class<T>,boolean,TargetingConditions.Selector)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java:12 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NearestHealableRaiderTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Raider raiderClass<T> class_boolean blTargetingConditions.Selector selector
ตัวอย่างใช้งาน
Raider raider = ...;
Class<T> class_ = ...;
TargetingConditions.Selector selector = ...;
NearestHealableRaiderTargetGoal instance = new NearestHealableRaiderTargetGoal(raider, class_, true, selector);
net.minecraft.world.entity.ai.goal.target.NearestHealableRaiderTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java:38 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
แก้ state: cooldown. เรียกต่อ: reducedTickDelay().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
NonTameRandomTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.NonTameRandomTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java - Type:
class - Modifiers:
public - Extends:
NearestAttackableTargetGoal<T>
net.minecraft.world.entity.ai.goal.target.NonTameRandomTargetGoal#canContinueToUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java:21 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Continue To Use
ทำงานยังไง
เรียกต่อ: test(), getServerLevel(). คืนค่า: this.targetConditions != null ? this.targetConditions.test(getServerLevel(this.mob), this.mob, this.target) : super.canContinueToUse().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NonTameRandomTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java:16 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
เรียกต่อ: isTame(). คืนค่า: !this.tamableMob.isTame() && super.canUse().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.NonTameRandomTargetGoal#NonTameRandomTargetGoal(TamableAnimal,Class<T>,boolean,TargetingConditions.Selector)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NonTameRandomTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: tamableMob.
Parameters
TamableAnimal tamableAnimalClass<T> class_boolean blTargetingConditions.Selector selector
ตัวอย่างใช้งาน
TamableAnimal tamableAnimal = ...;
Class<T> class_ = ...;
TargetingConditions.Selector selector = ...;
NonTameRandomTargetGoal instance = new NonTameRandomTargetGoal(tamableAnimal, class_, true, selector);
OwnerHurtByTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.java - Type:
class - Modifiers:
public - Extends:
TargetGoal
net.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.java:20 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: ownerLastHurtBy. เรียกต่อ: isTame(), isOrderedToSit(), getOwner(), getLastHurtByMob(), getLastHurtByMobTimestamp(), canAttack(), wantsToAttack(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoal#OwnerHurtByTargetGoal(TamableAnimal)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.java:14 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ OwnerHurtByTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: tameAnimal. เรียกต่อ: setFlags(), of().
Parameters
TamableAnimal tamableAnimal
ตัวอย่างใช้งาน
TamableAnimal tamableAnimal = ...;
OwnerHurtByTargetGoal instance = new OwnerHurtByTargetGoal(tamableAnimal);
net.minecraft.world.entity.ai.goal.target.OwnerHurtByTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtByTargetGoal.java:38 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: timestamp. เรียกต่อ: setTarget(), getOwner(), getLastHurtByMobTimestamp().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
OwnerHurtTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.java - Type:
class - Modifiers:
public - Extends:
TargetGoal
net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.java:20 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: ownerLastHurt. เรียกต่อ: isTame(), isOrderedToSit(), getOwner(), getLastHurtMob(), getLastHurtMobTimestamp(), canAttack(), wantsToAttack(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal#OwnerHurtTargetGoal(TamableAnimal)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.java:14 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ OwnerHurtTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: tameAnimal. เรียกต่อ: setFlags(), of().
Parameters
TamableAnimal tamableAnimal
ตัวอย่างใช้งาน
TamableAnimal tamableAnimal = ...;
OwnerHurtTargetGoal instance = new OwnerHurtTargetGoal(tamableAnimal);
net.minecraft.world.entity.ai.goal.target.OwnerHurtTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/OwnerHurtTargetGoal.java:38 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: timestamp. เรียกต่อ: setTarget(), getOwner(), getLastHurtMobTimestamp().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ResetUniversalAngerTargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/ResetUniversalAngerTargetGoal.java - Type:
class - Modifiers:
public - Extends:
Goal
net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal#canUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/ResetUniversalAngerTargetGoal.java:24 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Use
ทำงานยังไง
เรียกต่อ: getServerLevel(), getGameRules(), getBoolean(), wasHurtByPlayer(). คืนค่า: getServerLevel(this.mob).getGameRules().getBoolean(GameRules.RULE_UNIVERSAL_ANGER) && this.wasHurtByPlayer().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal#ResetUniversalAngerTargetGoal(T,boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/ResetUniversalAngerTargetGoal.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ResetUniversalAngerTargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: mob, alertOthersOfSameType.
Parameters
T mobboolean bl
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.ResetUniversalAngerTargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/ResetUniversalAngerTargetGoal.java:35 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: lastHurtByPlayerTimestamp. เรียกต่อ: getLastHurtByMobTimestamp(), forgetCurrentTargetAndRefreshUniversalAnger(), getNearbyMobsOfSameType(), stream(), filter(), map(), forEach().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
TargetGoal
- Full name:
net.minecraft.world.entity.ai.goal.target.TargetGoal - Package:
net.minecraft.world.entity.ai.goal.target - Source:
common—net/minecraft/world/entity/ai/goal/target/TargetGoal.java - Type:
class - Modifiers:
public abstract - Extends:
Goal
net.minecraft.world.entity.ai.goal.target.TargetGoal#canAttack(LivingEntity,TargetingConditions)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:92 - Modifiers:
protected - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: reachCache. เรียกต่อ: test(), getServerLevel(), isWithinRestriction(), blockPosition(), canReach(). มีจุด return อย่างน้อย 5 จุด.
Parameters
LivingEntity livingEntityTargetingConditions targetingConditions
ตัวอย่างใช้งาน
LivingEntity livingEntity = ...;
TargetingConditions targetingConditions = ...;
@Override
protected boolean canAttack(LivingEntity livingEntity, TargetingConditions targetingConditions) {
return super.canAttack(livingEntity, targetingConditions);
}
net.minecraft.world.entity.ai.goal.target.TargetGoal#canContinueToUse()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:37 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Continue To Use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: unseenTicks. เรียกต่อ: getTarget(), canAttack(), getTeam(), getFollowDistance(), distanceToSqr(), getSensing(), hasLineOfSight(), reducedTickDelay(). มีจุด return อย่างน้อย 6 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#getFollowDistance()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:75 - Modifiers:
protected - Return:
double
คืออะไร
อ่านค่า Follow Distance
ทำงานยังไง
เรียกต่อ: getAttributeValue(). คืนค่า: this.mob.getAttributeValue(Attributes.FOLLOW_RANGE).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#setUnseenMemoryTicks(int)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:139 - Modifiers:
public - Return:
TargetGoal
คืออะไร
กำหนดค่า Unseen Memory Ticks
ทำงานยังไง
แก้ state: unseenMemoryTicks. คืนค่า: this.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#start()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:79 - Modifiers:
public - Return:
void
คืออะไร
เริ่ม start
ทำงานยังไง
แก้ state: reachCache, reachCacheTime, unseenTicks.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#stop()
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:86 - Modifiers:
public - Return:
void
คืออะไร
หยุด stop
ทำงานยังไง
แก้ state: targetMob. เรียกต่อ: setTarget().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#TargetGoal(Mob,boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:27 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Mob mobboolean bl
ตัวอย่างใช้งาน
net.minecraft.world.entity.ai.goal.target.TargetGoal#TargetGoal(Mob,boolean,boolean)
- Origin:
common - Source:
net/minecraft/world/entity/ai/goal/target/TargetGoal.java:31 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TargetGoal ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: mob, mustSee, mustReach.
Parameters
Mob mobboolean blboolean bl2