Skip to content

Package net.minecraft.world.entity.animal.goat

Part 1/1


Goat

  • Full name: net.minecraft.world.entity.animal.goat.Goat
  • Package: net.minecraft.world.entity.animal.goat
  • Source: commonnet/minecraft/world/entity/animal/goat/Goat.java
  • Type: class
  • Modifiers: public
  • Extends: Animal

net.minecraft.world.entity.animal.goat.Goat#addAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:274
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Additional Save Data

ทำงานยังไง

เรียกต่อ: putBoolean(), isScreamingGoat(), hasLeftHorn(), hasRightHorn().

Parameters

  • CompoundTag compoundTag

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

Goat instance = ...;
CompoundTag compoundTag = ...;
instance.addAdditionalSaveData(compoundTag);

net.minecraft.world.entity.animal.goat.Goat#addHorns()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:356
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Horns

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
instance.addHorns();

net.minecraft.world.entity.animal.goat.Goat#ageBoundaryReached()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:128
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ ageBoundaryReached ตาม implementation ของ Goat

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isBaby(), getAttribute(), setBaseValue(), removeHorns(), addHorns().

Parameters

  • ไม่มี

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

@Override
protected void ageBoundaryReached() {
    super.ageBoundaryReached();
}

net.minecraft.world.entity.animal.goat.Goat#aiStep()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:301
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ aiStep ตาม implementation ของ Goat

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
instance.aiStep();

net.minecraft.world.entity.animal.goat.Goat#brainProvider()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:114
  • Modifiers: protected
  • Return: Brain.Provider<Goat>

คืออะไร

ดำเนินการ brainProvider ตาม implementation ของ Goat

ทำงานยังไง

เรียกต่อ: provider(). คืนค่า: Brain.provider(MEMORY_TYPES, SENSOR_TYPES).

Parameters

  • ไม่มี

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

@Override
protected Brain.Provider<Goat> brainProvider() {
    return super.brainProvider();
}

net.minecraft.world.entity.animal.goat.Goat#calculateFallDamage(float,float)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:139
  • Modifiers: protected
  • Return: int

คืออะไร

คำนวณ Fall Damage

ทำงานยังไง

คืนค่า: super.calculateFallDamage(f, g) - 10.

Parameters

  • float f
  • float g

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

@Override
protected int calculateFallDamage(float f, float g) {
    return super.calculateFallDamage(f, g);
}

net.minecraft.world.entity.animal.goat.Goat#checkGoatSpawnRules(EntityType<? extends Animal>,LevelAccessor,EntitySpawnReason,BlockPos,RandomSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:378
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบ Goat Spawn Rules

ทำงานยังไง

เรียกต่อ: getBlockState(), below(), is(), isBrightEnoughToSpawn(). คืนค่า: levelAccessor.getBlockState(blockPos.below()).is(BlockTags.GOATS_SPAWNABLE_ON) && isBrightEnoughToSpawn(levelAccessor, blockPos).

Parameters

  • EntityType<? extends Animal> entityType
  • LevelAccessor levelAccessor
  • EntitySpawnReason entitySpawnReason
  • BlockPos blockPos
  • RandomSource randomSource

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

EntityType<? extends Animal> entityType = ...;
LevelAccessor levelAccessor = ...;
EntitySpawnReason entitySpawnReason = ...;
BlockPos blockPos = ...;
RandomSource randomSource = ...;
boolean result = Goat.checkGoatSpawnRules(entityType, levelAccessor, entitySpawnReason, blockPos, randomSource);

net.minecraft.world.entity.animal.goat.Goat#createAttributes()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:124
  • Modifiers: public static
  • Return: AttributeSupplier.Builder

คืออะไร

สร้าง Attributes

ทำงานยังไง

เรียกต่อ: createAnimalAttributes(), add(). คืนค่า: Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 10.0).add(Attributes.MOVEMENT_SPEED, 0.2F).add(Attributes.ATTACK_DAMAGE, 2.0).

Parameters

  • ไม่มี

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

AttributeSupplier.Builder result = Goat.createAttributes();

net.minecraft.world.entity.animal.goat.Goat#createHorn()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:103
  • Modifiers: public
  • Return: ItemStack

คืออะไร

สร้าง Horn

ทำงานยังไง

เรียกต่อ: create(), getUUID(), hashCode(), isScreamingGoat(), level(), registryAccess(), lookupOrThrow(), getRandomElementOf(). สร้างออบเจ็กต์: ItemStack.

Parameters

  • ไม่มี

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

Goat instance = ...;
ItemStack result = instance.createHorn();

net.minecraft.world.entity.animal.goat.Goat#customServerAiStep(ServerLevel)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:186
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ customServerAiStep ตาม implementation ของ Goat

ทำงานยังไง

เรียกต่อ: get(), push(), getBrain(), tick(), pop(), updateActivity().

Parameters

  • ServerLevel serverLevel

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

ServerLevel serverLevel = ...;
@Override
protected void customServerAiStep(ServerLevel serverLevel) {
    super.customServerAiStep(serverLevel);
}

net.minecraft.world.entity.animal.goat.Goat#defineSynchedData(SynchedEntityData.Builder)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:313
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ defineSynchedData ตาม implementation ของ Goat

ทำงานยังไง

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

Parameters

  • SynchedEntityData.Builder builder

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

SynchedEntityData.Builder builder = ...;
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
    super.defineSynchedData(builder);
}

net.minecraft.world.entity.animal.goat.Goat#dropHorn()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:329
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ dropHorn ตาม implementation ของ Goat

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: hasLeftHorn(), hasRightHorn(), nextBoolean(), set(), position(), createHorn(), randomBetween(), level(). สร้างออบเจ็กต์: ItemEntity. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ไม่มี

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

Goat instance = ...;
boolean result = instance.dropHorn();

net.minecraft.world.entity.animal.goat.Goat#finalizeSpawn(ServerLevelAccessor,DifficultyInstance,EntitySpawnReason,SpawnGroupData)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:247
  • Modifiers: public
  • Return: SpawnGroupData

คืออะไร

ดำเนินการ finalizeSpawn ตาม implementation ของ Goat

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getRandom(), initMemories(), setScreamingGoat(), nextDouble(), ageBoundaryReached(), isBaby(), nextFloat(), nextBoolean(). คืนค่า: super.finalizeSpawn(serverLevelAccessor, difficultyInstance, entitySpawnReason, spawnGroupData).

Parameters

  • ServerLevelAccessor serverLevelAccessor
  • DifficultyInstance difficultyInstance
  • EntitySpawnReason entitySpawnReason
  • SpawnGroupData spawnGroupData

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

Goat instance = ...;
ServerLevelAccessor serverLevelAccessor = ...;
DifficultyInstance difficultyInstance = ...;
EntitySpawnReason entitySpawnReason = ...;
SpawnGroupData spawnGroupData = ...;
SpawnGroupData result = instance.finalizeSpawn(serverLevelAccessor, difficultyInstance, entitySpawnReason, spawnGroupData);

net.minecraft.world.entity.animal.goat.Goat#getAmbientSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:144
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Ambient Sound

ทำงานยังไง

เรียกต่อ: isScreamingGoat(). คืนค่า: this.isScreamingGoat() ? SoundEvents.GOAT_SCREAMING_AMBIENT : SoundEvents.GOAT_AMBIENT.

Parameters

  • ไม่มี

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

@Override
protected SoundEvent getAmbientSound() {
    return super.getAmbientSound();
}

net.minecraft.world.entity.animal.goat.Goat#getBrain()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:181
  • Modifiers: public
  • Return: Brain<Goat>

คืออะไร

อ่านค่า Brain

ทำงานยังไง

คืนค่า: (Brain<Goat>)super.getBrain().

Parameters

  • ไม่มี

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

Goat instance = ...;
Brain<Goat> result = instance.getBrain();

net.minecraft.world.entity.animal.goat.Goat#getBreedOffspring(ServerLevel,AgeableMob)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:168
  • Modifiers: public
  • Return: Goat

คืออะไร

อ่านค่า Breed Offspring

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: create(), initMemories(), getRandom(), nextBoolean(), isScreamingGoat(), nextDouble(), setScreamingGoat(). คืนค่า: goat.

Parameters

  • ServerLevel serverLevel
  • AgeableMob ageableMob

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

Goat instance = ...;
ServerLevel serverLevel = ...;
AgeableMob ageableMob = ...;
Goat result = instance.getBreedOffspring(serverLevel, ageableMob);

net.minecraft.world.entity.animal.goat.Goat#getDeathSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:154
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Death Sound

ทำงานยังไง

เรียกต่อ: isScreamingGoat(). คืนค่า: this.isScreamingGoat() ? SoundEvents.GOAT_SCREAMING_DEATH : SoundEvents.GOAT_DEATH.

Parameters

  • ไม่มี

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

@Override
protected SoundEvent getDeathSound() {
    return super.getDeathSound();
}

net.minecraft.world.entity.animal.goat.Goat#getDefaultDimensions(Pose)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:269
  • Modifiers: public
  • Return: EntityDimensions

คืออะไร

อ่านค่า Default Dimensions

ทำงานยังไง

เรียกต่อ: scale(), getAgeScale(). คืนค่า: pose == Pose.LONG_JUMPING ? LONG_JUMPING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose).

Parameters

  • Pose pose

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

Goat instance = ...;
Pose pose = ...;
EntityDimensions result = instance.getDefaultDimensions(pose);

net.minecraft.world.entity.animal.goat.Goat#getHurtSound(DamageSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:149
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Hurt Sound

ทำงานยังไง

เรียกต่อ: isScreamingGoat(). คืนค่า: this.isScreamingGoat() ? SoundEvents.GOAT_SCREAMING_HURT : SoundEvents.GOAT_HURT.

Parameters

  • DamageSource damageSource

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

DamageSource damageSource = ...;
@Override
protected SoundEvent getHurtSound(DamageSource damageSource) {
    return super.getHurtSound(damageSource);
}

net.minecraft.world.entity.animal.goat.Goat#getMaxHeadYRot()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:198
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Max Head YRot

ทำงานยังไง

คืนค่า: 15.

Parameters

  • ไม่มี

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

Goat instance = ...;
int result = instance.getMaxHeadYRot();

net.minecraft.world.entity.animal.goat.Goat#getMilkingSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:164
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Milking Sound

ทำงานยังไง

เรียกต่อ: isScreamingGoat(). คืนค่า: this.isScreamingGoat() ? SoundEvents.GOAT_SCREAMING_MILK : SoundEvents.GOAT_MILK.

Parameters

  • ไม่มี

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

@Override
protected SoundEvent getMilkingSound() {
    return super.getMilkingSound();
}

net.minecraft.world.entity.animal.goat.Goat#getRammingXHeadRot()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:374
  • Modifiers: public
  • Return: float

คืออะไร

อ่านค่า Ramming XHead Rot

ทำงานยังไง

คืนค่า: this.lowerHeadTick / 20.0F * 30.0F * (float) (Math.PI / 180.0).

Parameters

  • ไม่มี

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

Goat instance = ...;
float result = instance.getRammingXHeadRot();

net.minecraft.world.entity.animal.goat.Goat#Goat(EntityType<? extends Goat>,Level)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:96
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

เรียกต่อ: getNavigation(), setCanFloat(), setPathfindingMalus().

Parameters

  • EntityType<? extends Goat> entityType
  • Level level

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

EntityType<? extends Goat> entityType = ...;
Level level = ...;
Goat instance = new Goat(entityType, level);

net.minecraft.world.entity.animal.goat.Goat#handleEntityEvent(byte)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:290
  • Modifiers: public
  • Return: void

คืออะไร

จัดการ Entity Event

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: isLoweringHead.

Parameters

  • byte b

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

Goat instance = ...;
instance.handleEntityEvent(0);

net.minecraft.world.entity.animal.goat.Goat#hasLeftHorn()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:321
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Left Horn

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
boolean result = instance.hasLeftHorn();

net.minecraft.world.entity.animal.goat.Goat#hasRightHorn()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:325
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี Right Horn

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
boolean result = instance.hasRightHorn();

net.minecraft.world.entity.animal.goat.Goat#isFood(ItemStack)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:224
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

เรียกต่อ: is(). คืนค่า: itemStack.is(ItemTags.GOAT_FOOD).

Parameters

  • ItemStack itemStack

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

Goat instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isFood(itemStack);

net.minecraft.world.entity.animal.goat.Goat#isScreamingGoat()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:366
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Screaming Goat

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
boolean result = instance.isScreamingGoat();

net.minecraft.world.entity.animal.goat.Goat#makeBrain(Dynamic<?>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:119
  • Modifiers: protected
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

เรียกต่อ: brainProvider(). คืนค่า: GoatAi.makeBrain(this.brainProvider().makeBrain(dynamic)).

Parameters

  • Dynamic<?> dynamic

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

Dynamic<?> dynamic = ...;
@Override
protected Brain<?> makeBrain(Dynamic<?> dynamic) {
    return super.makeBrain(dynamic);
}

net.minecraft.world.entity.animal.goat.Goat#mobInteract(Player,InteractionHand)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:229
  • Modifiers: public
  • Return: InteractionResult

คืออะไร

ดำเนินการ mobInteract ตาม implementation ของ Goat

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), is(), isBaby(), playSound(), getMilkingSound(), createFilledResult(), getDefaultInstance(), setItemInHand(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Player player
  • InteractionHand interactionHand

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

Goat instance = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.mobInteract(player, interactionHand);

net.minecraft.world.entity.animal.goat.Goat#playEatingSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:211
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ playEatingSound ตาม implementation ของ Goat

ทำงานยังไง

เรียกต่อ: level(), playSound(), isScreamingGoat(), randomBetween().

Parameters

  • ไม่มี

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

@Override
protected void playEatingSound() {
    super.playEatingSound();
}

net.minecraft.world.entity.animal.goat.Goat#playStepSound(BlockPos,BlockState)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:159
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ playStepSound ตาม implementation ของ Goat

ทำงานยังไง

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

Parameters

  • BlockPos blockPos
  • BlockState blockState

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

BlockPos blockPos = ...;
BlockState blockState = ...;
@Override
protected void playStepSound(BlockPos blockPos, BlockState blockState) {
    super.playStepSound(blockPos, blockState);
}

net.minecraft.world.entity.animal.goat.Goat#readAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:282
  • Modifiers: public
  • Return: void

คืออะไร

อ่าน Additional Save Data

ทำงานยังไง

เรียกต่อ: setScreamingGoat(), getBoolean(), set().

Parameters

  • CompoundTag compoundTag

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

Goat instance = ...;
CompoundTag compoundTag = ...;
instance.readAdditionalSaveData(compoundTag);

net.minecraft.world.entity.animal.goat.Goat#removeHorns()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:361
  • Modifiers: public
  • Return: void

คืออะไร

ลบ Horns

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Goat instance = ...;
instance.removeHorns();

net.minecraft.world.entity.animal.goat.Goat#sendDebugPackets()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:263
  • Modifiers: protected
  • Return: void

คืออะไร

ส่ง Debug Packets

ทำงานยังไง

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

Parameters

  • ไม่มี

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

@Override
protected void sendDebugPackets() {
    super.sendDebugPackets();
}

net.minecraft.world.entity.animal.goat.Goat#setScreamingGoat(boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:370
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Screaming Goat

ทำงานยังไง

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

Parameters

  • boolean bl

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

Goat instance = ...;
instance.setScreamingGoat(true);

net.minecraft.world.entity.animal.goat.Goat#setYHeadRot(float)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/Goat.java:203
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า YHead Rot

ทำงานยังไง

เรียกต่อ: getMaxHeadYRot(), degreesDifference(), clamp().

Parameters

  • float f

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

Goat instance = ...;
instance.setYHeadRot(0.0F);

GoatAi

  • Full name: net.minecraft.world.entity.animal.goat.GoatAi
  • Package: net.minecraft.world.entity.animal.goat
  • Source: commonnet/minecraft/world/entity/animal/goat/GoatAi.java
  • Type: class
  • Modifiers: public

net.minecraft.world.entity.animal.goat.GoatAi#getTemptations()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/GoatAi.java:175
  • Modifiers: public static
  • Return: Predicate<ItemStack>

คืออะไร

อ่านค่า Temptations

ทำงานยังไง

เรียกต่อ: is(). คืนค่า: itemStack -> itemStack.is(ItemTags.GOAT_FOOD).

Parameters

  • ไม่มี

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

Predicate<ItemStack> result = GoatAi.getTemptations();

net.minecraft.world.entity.animal.goat.GoatAi#initMemories(Goat,RandomSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/GoatAi.java:63
  • Modifiers: protected static
  • Return: void

คืออะไร

ดำเนินการ initMemories ตาม implementation ของ GoatAi

ทำงานยังไง

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

Parameters

  • Goat goat
  • RandomSource randomSource

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

Goat goat = ...;
RandomSource randomSource = ...;
@Override
protected void initMemories(Goat goat, RandomSource randomSource) {
    super.initMemories(goat, randomSource);
}

net.minecraft.world.entity.animal.goat.GoatAi#makeBrain(Brain<Goat>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/GoatAi.java:68
  • Modifiers: protected static
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

เรียกต่อ: initCoreActivity(), initIdleActivity(), initLongJumpActivity(), initRamActivity(), setCoreActivities(), of(), setDefaultActivity(), useDefaultActivity(). คืนค่า: brain.

Parameters

  • Brain<Goat> brain

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

Brain<Goat> brain = ...;
@Override
protected Brain<?> makeBrain(Brain<Goat> brain) {
    return super.makeBrain(brain);
}

net.minecraft.world.entity.animal.goat.GoatAi#updateActivity(Goat)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/goat/GoatAi.java:171
  • Modifiers: public static
  • Return: void

คืออะไร

อัปเดต Activity

ทำงานยังไง

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

Parameters

  • Goat goat

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

Goat goat = ...;
GoatAi.updateActivity(goat);