Skip to content

Package net.minecraft.world.entity.animal.frog

Part 1/1


Frog

  • Full name: net.minecraft.world.entity.animal.frog.Frog
  • Package: net.minecraft.world.entity.animal.frog
  • Source: commonnet/minecraft/world/entity/animal/frog/Frog.java
  • Type: class
  • Modifiers: public
  • Extends: Animal
  • Implements: VariantHolder<Holder<FrogVariant>>

net.minecraft.world.entity.animal.frog.Frog#addAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:170
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Additional Save Data

ทำงานยังไง

เรียกต่อ: putString(), getVariant(), unwrapKey(), orElse(), location(), toString().

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.animal.frog.Frog#brainProvider()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:118
  • Modifiers: protected
  • Return: Brain.Provider<Frog>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#calculateFallDamage(float,float)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:334
  • Modifiers: protected
  • Return: int

คืออะไร

คำนวณ Fall Damage

ทำงานยังไง

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

Parameters

  • float f
  • float g

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

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

net.minecraft.world.entity.animal.frog.Frog#canEat(LivingEntity)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:350
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Eat

ทำงานยังไง

เรียกต่อ: getSize(), getType(), is(). คืนค่า: livingEntity instanceof Slime slime && slime.getSize() != 1 ? false : livingEntity.getType().is(EntityTypeTags.FROG_FOOD).

Parameters

  • LivingEntity livingEntity

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

LivingEntity livingEntity = ...;
boolean result = Frog.canEat(livingEntity);

net.minecraft.world.entity.animal.frog.Frog#checkFrogSpawnRules(EntityType<? extends Animal>,LevelAccessor,EntitySpawnReason,BlockPos,RandomSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:370
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบ Frog Spawn Rules

ทำงานยังไง

เรียกต่อ: getBlockState(), below(), is(), isBrightEnoughToSpawn(). คืนค่า: levelAccessor.getBlockState(blockPos.below()).is(BlockTags.FROGS_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 = Frog.checkFrogSpawnRules(entityType, levelAccessor, entitySpawnReason, blockPos, randomSource);

net.minecraft.world.entity.animal.frog.Frog#createAttributes()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:292
  • Modifiers: public static
  • Return: AttributeSupplier.Builder

คืออะไร

สร้าง Attributes

ทำงานยังไง

เรียกต่อ: createAnimalAttributes(), add().

Parameters

  • ไม่มี

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

AttributeSupplier.Builder result = Frog.createAttributes();

net.minecraft.world.entity.animal.frog.Frog#createNavigation(Level)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:354
  • Modifiers: protected
  • Return: PathNavigation

คืออะไร

สร้าง Navigation

ทำงานยังไง

เรียกต่อ: FrogPathNavigation(). สร้างออบเจ็กต์: Frog.FrogPathNavigation. คืนค่า: new Frog.FrogPathNavigation(this, level).

Parameters

  • Level level

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

Level level = ...;
@Override
protected PathNavigation createNavigation(Level level) {
    return super.createNavigation(level);
}

net.minecraft.world.entity.animal.frog.Frog#customServerAiStep(ServerLevel)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:185
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

เรียกต่อ: 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.frog.Frog#defineSynchedData(SynchedEntityData.Builder)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:133
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • SynchedEntityData.Builder builder

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

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

net.minecraft.world.entity.animal.frog.Frog#eraseTongueTarget()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:140
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ eraseTongueTarget ตาม implementation ของ Frog

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Frog instance = ...;
instance.eraseTongueTarget();

net.minecraft.world.entity.animal.frog.Frog#finalizeSpawn(ServerLevelAccessor,DifficultyInstance,EntitySpawnReason,SpawnGroupData)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:275
  • Modifiers: public
  • Return: SpawnGroupData

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBiome(), blockPosition(), is(), setVariant(), getOrThrow(), initMemories(), getRandom(). คืนค่า: super.finalizeSpawn(serverLevelAccessor, difficultyInstance, entitySpawnReason, spawnGroupData).

Parameters

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

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

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

net.minecraft.world.entity.animal.frog.Frog#Frog(EntityType<? extends Animal>,Level)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:110
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: lookControl, moveControl. เรียกต่อ: FrogLookControl(), setPathfindingMalus(). สร้างออบเจ็กต์: Frog.FrogLookControl, SmoothSwimmingMoveControl.

Parameters

  • EntityType<? extends Animal> entityType
  • Level level

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

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

net.minecraft.world.entity.animal.frog.Frog#getAmbientSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:300
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Ambient Sound

ทำงานยังไง

คืนค่า: SoundEvents.FROG_AMBIENT.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#getBrain()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:128
  • Modifiers: public
  • Return: Brain<Frog>

คืออะไร

อ่านค่า Brain

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#getBreedOffspring(ServerLevel,AgeableMob)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:249
  • Modifiers: public
  • Return: AgeableMob

คืออะไร

อ่านค่า Breed Offspring

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • AgeableMob ageableMob

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

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

net.minecraft.world.entity.animal.frog.Frog#getDeathSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:312
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Death Sound

ทำงานยังไง

คืนค่า: SoundEvents.FROG_DEATH.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#getHeadRotSpeed()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:152
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Head Rot Speed

ทำงานยังไง

คืนค่า: 35.

Parameters

  • ไม่มี

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

Frog instance = ...;
int result = instance.getHeadRotSpeed();

net.minecraft.world.entity.animal.frog.Frog#getHurtSound(DamageSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:306
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Hurt Sound

ทำงานยังไง

คืนค่า: SoundEvents.FROG_HURT.

Parameters

  • DamageSource damageSource

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

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

net.minecraft.world.entity.animal.frog.Frog#getMaxHeadYRot()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:157
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Max Head YRot

ทำงานยังไง

คืนค่า: 5.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#getTarget()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:359
  • Modifiers: public
  • Return: LivingEntity

คืออะไร

อ่านค่า Target

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Frog instance = ...;
LivingEntity result = instance.getTarget();

net.minecraft.world.entity.animal.frog.Frog#getTongueTarget()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:144
  • Modifiers: public
  • Return: Optional<Entity>

คืออะไร

อ่านค่า Tongue Target

ทำงานยังไง

เรียกต่อ: get(), stream(), mapToObj(), level(), filter(), findFirst(). คืนค่า: this.entityData.get(DATA_TONGUE_TARGET_ID).stream().mapToObj(this.level()::getEntity).filter(Objects::nonNull).findFirst().

Parameters

  • ไม่มี

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

Frog instance = ...;
Optional<Entity> result = instance.getTongueTarget();

net.minecraft.world.entity.animal.frog.Frog#getVariant()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:162
  • Modifiers: public
  • Return: Holder<FrogVariant>

คืออะไร

อ่านค่า Variant

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Frog instance = ...;
Holder<FrogVariant> result = instance.getVariant();

net.minecraft.world.entity.animal.frog.Frog#isBaby()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:260
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: false.

Parameters

  • ไม่มี

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

Frog instance = ...;
boolean result = instance.isBaby();

net.minecraft.world.entity.animal.frog.Frog#isFood(ItemStack)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:365
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ItemStack itemStack

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

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

net.minecraft.world.entity.animal.frog.Frog#isPushedByFluid()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:323
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Pushed By Fluid

ทำงานยังไง

คืนค่า: false.

Parameters

  • ไม่มี

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

Frog instance = ...;
boolean result = instance.isPushedByFluid();

net.minecraft.world.entity.animal.frog.Frog#makeBrain(Dynamic<?>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:123
  • Modifiers: protected
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

เรียกต่อ: brainProvider(). คืนค่า: FrogAi.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.frog.Frog#onSyncedDataUpdated(EntityDataAccessor<?>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:206
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Synced Data Updated

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: equals(), getPose(), start(), stop().

Parameters

  • EntityDataAccessor<?> entityDataAccessor

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

Frog instance = ...;
EntityDataAccessor<?> entityDataAccessor = ...;
instance.onSyncedDataUpdated(entityDataAccessor);

net.minecraft.world.entity.animal.frog.Frog#playEatingSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:244
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Frog instance = ...;
instance.playEatingSound();

net.minecraft.world.entity.animal.frog.Frog#playStepSound(BlockPos,BlockState)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:318
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

เรียกต่อ: 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.frog.Frog#readAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:176
  • Modifiers: public
  • Return: void

คืออะไร

อ่าน Additional Save Data

ทำงานยังไง

เรียกต่อ: ofNullable(), tryParse(), getString(), map(), create(), flatMap(), ifPresent().

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.animal.frog.Frog#sendDebugPackets()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:328
  • Modifiers: protected
  • Return: void

คืออะไร

ส่ง Debug Packets

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Frog#setBaby(boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:265
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Baby

ทำงานยังไง

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

Parameters

  • boolean bl

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

Frog instance = ...;
instance.setBaby(true);

net.minecraft.world.entity.animal.frog.Frog#setTongueTarget(Entity)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:148
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Tongue Target

ทำงานยังไง

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

Parameters

  • Entity entity

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

Frog instance = ...;
Entity entity = ...;
instance.setTongueTarget(entity);

net.minecraft.world.entity.animal.frog.Frog#setVariant(Holder<FrogVariant>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:166
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Variant

ทำงานยังไง

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

Parameters

  • Holder<FrogVariant> holder

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

Frog instance = ...;
Holder<FrogVariant> holder = ...;
instance.setVariant(holder);

net.minecraft.world.entity.animal.frog.Frog#spawnChildFromBreeding(ServerLevel,Animal)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:269
  • Modifiers: public
  • Return: void

คืออะไร

สร้าง entity ในโลก Child From Breeding

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • Animal animal

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

Frog instance = ...;
ServerLevel serverLevel = ...;
Animal animal = ...;
instance.spawnChildFromBreeding(serverLevel, animal);

net.minecraft.world.entity.animal.frog.Frog#tick()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:197
  • Modifiers: public
  • Return: void

คืออะไร

ประมวลผล tick tick

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: level(), isClientSide(), animateWhen(), isInWaterOrBubble(), isMoving().

Parameters

  • ไม่มี

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

Frog instance = ...;
instance.tick();

net.minecraft.world.entity.animal.frog.Frog#travel(Vec3)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:339
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ travel ตาม implementation ของ Frog

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isControlledByLocalInstance(), isInWater(), moveRelative(), getSpeed(), move(), getDeltaMovement(), setDeltaMovement(), scale().

Parameters

  • Vec3 vec3

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

Frog instance = ...;
Vec3 vec3 = ...;
instance.travel(vec3);

net.minecraft.world.entity.animal.frog.Frog#updateWalkAnimation(float)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Frog.java:232
  • Modifiers: protected
  • Return: void

คืออะไร

อัปเดต Walk Animation

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isStarted(), min(), update(), isBaby().

Parameters

  • float f

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

@Override
protected void updateWalkAnimation(float f) {
    super.updateWalkAnimation(f);
}

FrogAi

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

net.minecraft.world.entity.animal.frog.FrogAi#getTemptations()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/FrogAi.java:236
  • Modifiers: public static
  • Return: Predicate<ItemStack>

คืออะไร

อ่านค่า Temptations

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.FrogAi#initMemories(Frog,RandomSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/FrogAi.java:62
  • Modifiers: protected static
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • Frog frog
  • RandomSource randomSource

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

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

net.minecraft.world.entity.animal.frog.FrogAi#makeBrain(Brain<Frog>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/FrogAi.java:66
  • Modifiers: protected static
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

เรียกต่อ: initCoreActivity(), initIdleActivity(), initSwimActivity(), initLaySpawnActivity(), initTongueActivity(), initJumpActivity(), setCoreActivities(), of(). คืนค่า: brain.

Parameters

  • Brain<Frog> brain

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

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

net.minecraft.world.entity.animal.frog.FrogAi#updateActivity(Frog)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/FrogAi.java:232
  • Modifiers: public static
  • Return: void

คืออะไร

อัปเดต Activity

ทำงานยังไง

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

Parameters

  • Frog frog

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

Frog frog = ...;
FrogAi.updateActivity(frog);

ShootTongue

  • Full name: net.minecraft.world.entity.animal.frog.ShootTongue
  • Package: net.minecraft.world.entity.animal.frog
  • Source: commonnet/minecraft/world/entity/animal/frog/ShootTongue.java
  • Type: class
  • Modifiers: public
  • Extends: Behavior<Frog>

net.minecraft.world.entity.animal.frog.ShootTongue#canStillUse(ServerLevel,Frog,long)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:66
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Still Use

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • Frog frog
  • long l

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

ServerLevel serverLevel = ...;
Frog frog = ...;
@Override
protected boolean canStillUse(ServerLevel serverLevel, Frog frog, long l) {
    return super.canStillUse(serverLevel, frog, l);
}

net.minecraft.world.entity.animal.frog.ShootTongue#checkExtraStartConditions(ServerLevel,Frog)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:55
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบ Extra Start Conditions

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBrain(), getMemory(), get(), canPathfindToTarget(), eraseMemory(), addUnreachableTargetToMemory(), getPose(), canEat(). คืนค่า: bl && frog.getPose() != Pose.CROAKING && Frog.canEat(livingEntity).

Parameters

  • ServerLevel serverLevel
  • Frog frog

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

ServerLevel serverLevel = ...;
Frog frog = ...;
@Override
protected boolean checkExtraStartConditions(ServerLevel serverLevel, Frog frog) {
    return super.checkExtraStartConditions(serverLevel, frog);
}

net.minecraft.world.entity.animal.frog.ShootTongue#ShootTongue(SoundEvent,SoundEvent)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:37
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: tongueSound, eatSound. เรียกต่อ: of().

Parameters

  • SoundEvent soundEvent
  • SoundEvent soundEvent2

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

SoundEvent soundEvent = ...;
SoundEvent soundEvent2 = ...;
ShootTongue instance = new ShootTongue(soundEvent, soundEvent2);

net.minecraft.world.entity.animal.frog.ShootTongue#start(ServerLevel,Frog,long)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:72
  • Modifiers: protected
  • Return: void

คืออะไร

เริ่ม start

ทำงานยังไง

แก้ state: calculatePathCounter, state. เรียกต่อ: getBrain(), getMemory(), get(), lookAtEntity(), setTongueTarget(), setMemory(), position(). สร้างออบเจ็กต์: WalkTarget.

Parameters

  • ServerLevel serverLevel
  • Frog frog
  • long l

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

ServerLevel serverLevel = ...;
Frog frog = ...;
@Override
protected void start(ServerLevel serverLevel, Frog frog, long l) {
    super.start(serverLevel, frog, l);
}

net.minecraft.world.entity.animal.frog.ShootTongue#stop(ServerLevel,Frog,long)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:81
  • Modifiers: protected
  • Return: void

คืออะไร

หยุด stop

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • Frog frog
  • long l

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

ServerLevel serverLevel = ...;
Frog frog = ...;
@Override
protected void stop(ServerLevel serverLevel, Frog frog, long l) {
    super.stop(serverLevel, frog, l);
}

net.minecraft.world.entity.animal.frog.ShootTongue#tick(ServerLevel,Frog,long)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/ShootTongue.java:101
  • Modifiers: protected
  • Return: void

คืออะไร

ประมวลผล tick tick

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. แก้ state: itemSpawnPos, eatAnimationTimer, state, calculatePathCounter. เรียกต่อ: getBrain(), getMemory(), get(), setTongueTarget(), distanceTo(), playSound(), setPose(), setDeltaMovement(). สร้างออบเจ็กต์: WalkTarget.

Parameters

  • ServerLevel serverLevel
  • Frog frog
  • long l

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

ServerLevel serverLevel = ...;
Frog frog = ...;
@Override
protected void tick(ServerLevel serverLevel, Frog frog, long l) {
    super.tick(serverLevel, frog, l);
}

Tadpole

  • Full name: net.minecraft.world.entity.animal.frog.Tadpole
  • Package: net.minecraft.world.entity.animal.frog
  • Source: commonnet/minecraft/world/entity/animal/frog/Tadpole.java
  • Type: class
  • Modifiers: public
  • Extends: AbstractFish

net.minecraft.world.entity.animal.frog.Tadpole#addAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:121
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Additional Save Data

ทำงานยังไง

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

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.animal.frog.Tadpole#aiStep()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:113
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Tadpole instance = ...;
instance.aiStep();

net.minecraft.world.entity.animal.frog.Tadpole#brainProvider()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:77
  • Modifiers: protected
  • Return: Brain.Provider<Tadpole>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#createAttributes()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:109
  • Modifiers: public static
  • Return: AttributeSupplier.Builder

คืออะไร

สร้าง Attributes

ทำงานยังไง

เรียกต่อ: createAnimalAttributes(), add(). คืนค่า: Animal.createAnimalAttributes().add(Attributes.MOVEMENT_SPEED, 1.0).add(Attributes.MAX_HEALTH, 6.0).

Parameters

  • ไม่มี

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

AttributeSupplier.Builder result = Tadpole.createAttributes();

net.minecraft.world.entity.animal.frog.Tadpole#createNavigation(Level)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:72
  • Modifiers: protected
  • Return: PathNavigation

คืออะไร

สร้าง Navigation

ทำงานยังไง

สร้างออบเจ็กต์: WaterBoundPathNavigation. คืนค่า: new WaterBoundPathNavigation(this, level).

Parameters

  • Level level

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

Level level = ...;
@Override
protected PathNavigation createNavigation(Level level) {
    return super.createNavigation(level);
}

net.minecraft.world.entity.animal.frog.Tadpole#customServerAiStep(ServerLevel)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:97
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

เรียกต่อ: 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.frog.Tadpole#fromBucket()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:168
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ fromBucket ตาม implementation ของ Tadpole

ทำงานยังไง

คืนค่า: true.

Parameters

  • ไม่มี

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

Tadpole instance = ...;
boolean result = instance.fromBucket();

net.minecraft.world.entity.animal.frog.Tadpole#getAmbientSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:133
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Ambient Sound

ทำงานยังไง

คืนค่า: null.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#getBrain()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:87
  • Modifiers: public
  • Return: Brain<Tadpole>

คืออะไร

อ่านค่า Brain

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#getBucketItemStack()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:191
  • Modifiers: public
  • Return: ItemStack

คืออะไร

อ่านค่า Bucket Item Stack

ทำงานยังไง

สร้างออบเจ็กต์: ItemStack. คืนค่า: new ItemStack(Items.TADPOLE_BUCKET).

Parameters

  • ไม่มี

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

Tadpole instance = ...;
ItemStack result = instance.getBucketItemStack();

net.minecraft.world.entity.animal.frog.Tadpole#getDeathSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:145
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Death Sound

ทำงานยังไง

คืนค่า: SoundEvents.TADPOLE_DEATH.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#getFlopSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:92
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Flop Sound

ทำงานยังไง

คืนค่า: SoundEvents.TADPOLE_FLOP.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#getHurtSound(DamageSource)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:139
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Hurt Sound

ทำงานยังไง

คืนค่า: SoundEvents.TADPOLE_HURT.

Parameters

  • DamageSource damageSource

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

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

net.minecraft.world.entity.animal.frog.Tadpole#getPickupSound()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:196
  • Modifiers: public
  • Return: SoundEvent

คืออะไร

อ่านค่า Pickup Sound

ทำงานยังไง

คืนค่า: SoundEvents.BUCKET_FILL_TADPOLE.

Parameters

  • ไม่มี

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

Tadpole instance = ...;
SoundEvent result = instance.getPickupSound();

net.minecraft.world.entity.animal.frog.Tadpole#loadFromBucketTag(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:183
  • Modifiers: public
  • Return: void

คืออะไร

โหลด From Bucket Tag

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: loadDefaultDataFromBucketTag(), contains(), setAge(), getInt().

Parameters

  • CompoundTag compoundTag

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

Tadpole instance = ...;
CompoundTag compoundTag = ...;
instance.loadFromBucketTag(compoundTag);

net.minecraft.world.entity.animal.frog.Tadpole#makeBrain(Dynamic<?>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:82
  • Modifiers: protected
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

เรียกต่อ: brainProvider(). คืนค่า: TadpoleAi.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.frog.Tadpole#mobInteract(Player,InteractionHand)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:151
  • Modifiers: public
  • Return: InteractionResult

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), isFood(), feed(), bucketMobPickup(), orElse(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Player player
  • InteractionHand interactionHand

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

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

net.minecraft.world.entity.animal.frog.Tadpole#readAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:127
  • Modifiers: public
  • Return: void

คืออะไร

อ่าน Additional Save Data

ทำงานยังไง

เรียกต่อ: setAge(), getInt().

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.animal.frog.Tadpole#saveToBucketTag(ItemStack)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:177
  • Modifiers: public
  • Return: void

คืออะไร

บันทึก To Bucket Tag

ทำงานยังไง

เรียกต่อ: saveDefaultDataToBucketTag(), update(), putInt(), getAge().

Parameters

  • ItemStack itemStack

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

Tadpole instance = ...;
ItemStack itemStack = ...;
instance.saveToBucketTag(itemStack);

net.minecraft.world.entity.animal.frog.Tadpole#sendDebugPackets()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:162
  • Modifiers: protected
  • Return: void

คืออะไร

ส่ง Debug Packets

ทำงานยังไง

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

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.animal.frog.Tadpole#setFromBucket(boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:173
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า From Bucket

ทำงานยังไง

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

Parameters

  • boolean bl

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

Tadpole instance = ...;
instance.setFromBucket(true);

net.minecraft.world.entity.animal.frog.Tadpole#shouldDropExperience()

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:245
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าควร Drop Experience

ทำงานยังไง

คืนค่า: false.

Parameters

  • ไม่มี

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

Tadpole instance = ...;
boolean result = instance.shouldDropExperience();

net.minecraft.world.entity.animal.frog.Tadpole#Tadpole(EntityType<? extends AbstractFish>,Level)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/Tadpole.java:66
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: moveControl, lookControl. สร้างออบเจ็กต์: SmoothSwimmingMoveControl, SmoothSwimmingLookControl.

Parameters

  • EntityType<? extends AbstractFish> entityType
  • Level level

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

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

TadpoleAi

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

net.minecraft.world.entity.animal.frog.TadpoleAi#makeBrain(Brain<Tadpole>)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/TadpoleAi.java:30
  • Modifiers: protected static
  • Return: Brain<?>

คืออะไร

สร้าง Brain

ทำงานยังไง

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

Parameters

  • Brain<Tadpole> brain

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

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

net.minecraft.world.entity.animal.frog.TadpoleAi#updateActivity(Tadpole)

  • Origin: common
  • Source: net/minecraft/world/entity/animal/frog/TadpoleAi.java:73
  • Modifiers: public static
  • Return: void

คืออะไร

อัปเดต Activity

ทำงานยังไง

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

Parameters

  • Tadpole tadpole

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

Tadpole tadpole = ...;
TadpoleAi.updateActivity(tadpole);