Skip to content

Package net.minecraft.world.entity.boss.wither

Part 1/1


WitherBoss

  • Full name: net.minecraft.world.entity.boss.wither.WitherBoss
  • Package: net.minecraft.world.entity.boss.wither
  • Source: commonnet/minecraft/world/entity/boss/wither/WitherBoss.java
  • Type: class
  • Modifiers: public
  • Extends: Monster
  • Implements: RangedAttackMob

net.minecraft.world.entity.boss.wither.WitherBoss#addAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:116
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Additional Save Data

ทำงานยังไง

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

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#addEffect(MobEffectInstance,Entity)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:490
  • Modifiers: public
  • Return: boolean

คืออะไร

เพิ่ม Effect

ทำงานยังไง

คืนค่า: false.

Parameters

  • MobEffectInstance mobEffectInstance
  • Entity entity

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

WitherBoss instance = ...;
MobEffectInstance mobEffectInstance = ...;
Entity entity = ...;
boolean result = instance.addEffect(mobEffectInstance, entity);

net.minecraft.world.entity.boss.wither.WitherBoss#aiStep()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:152
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getDeltaMovement(), multiply(), level(), getAlternativeTarget(), getEntity(), getY(), isPowered(), max(). สร้างออบเจ็กต์: Vec3.

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
instance.aiStep();

net.minecraft.world.entity.boss.wither.WitherBoss#canBeAffected(MobEffectInstance)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:542
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Be Affected

ทำงานยังไง

เรียกต่อ: is(). คืนค่า: mobEffectInstance.is(MobEffects.WITHER) ? false : super.canBeAffected(mobEffectInstance).

Parameters

  • MobEffectInstance mobEffectInstance

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

WitherBoss instance = ...;
MobEffectInstance mobEffectInstance = ...;
boolean result = instance.canBeAffected(mobEffectInstance);

net.minecraft.world.entity.boss.wither.WitherBoss#canDestroy(BlockState)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:338
  • Modifiers: public static
  • Return: boolean

คืออะไร

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

ทำงานยังไง

เรียกต่อ: isAir(), is(). คืนค่า: !blockState.isAir() && !blockState.is(BlockTags.WITHER_IMMUNE).

Parameters

  • BlockState blockState

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

BlockState blockState = ...;
boolean result = WitherBoss.canDestroy(blockState);

net.minecraft.world.entity.boss.wither.WitherBoss#canRide(Entity)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:532
  • Modifiers: protected
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: false.

Parameters

  • Entity entity

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

Entity entity = ...;
@Override
protected boolean canRide(Entity entity) {
    return super.canRide(entity);
}

net.minecraft.world.entity.boss.wither.WitherBoss#canUsePortal(boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:537
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: false.

Parameters

  • boolean bl

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

WitherBoss instance = ...;
boolean result = instance.canUsePortal(true);

net.minecraft.world.entity.boss.wither.WitherBoss#checkDespawn()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:481
  • Modifiers: public
  • Return: void

คืออะไร

ตรวจสอบ Despawn

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: noActionTime. เรียกต่อ: level(), getDifficulty(), shouldDespawnInPeaceful(), discard().

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
instance.checkDespawn();

net.minecraft.world.entity.boss.wither.WitherBoss#createAttributes()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:495
  • Modifiers: public static
  • Return: AttributeSupplier.Builder

คืออะไร

สร้าง Attributes

ทำงานยังไง

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

Parameters

  • ไม่มี

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

AttributeSupplier.Builder result = WitherBoss.createAttributes();

net.minecraft.world.entity.boss.wither.WitherBoss#createNavigation(Level)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:88
  • Modifiers: protected
  • Return: PathNavigation

คืออะไร

สร้าง Navigation

ทำงานยังไง

เรียกต่อ: setCanOpenDoors(), setCanFloat(). สร้างออบเจ็กต์: FlyingPathNavigation. คืนค่า: flyingPathNavigation.

Parameters

  • Level level

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#customServerAiStep(ServerLevel)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:250
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: destroyBlocksTick. เรียกต่อ: getInvulnerableTicks(), setProgress(), explode(), getX(), getEyeY(), getZ(), isSilent(), globalLevelEvent().

Parameters

  • ServerLevel serverLevel

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#defineSynchedData(SynchedEntityData.Builder)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:107
  • Modifiers: protected
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • SynchedEntityData.Builder builder

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#dropCustomDeathLoot(ServerLevel,DamageSource,boolean)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:472
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ dropCustomDeathLoot ตาม implementation ของ WitherBoss

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • DamageSource damageSource
  • boolean bl

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

ServerLevel serverLevel = ...;
DamageSource damageSource = ...;
@Override
protected void dropCustomDeathLoot(ServerLevel serverLevel, DamageSource damageSource, boolean bl) {
    super.dropCustomDeathLoot(serverLevel, damageSource, bl);
}

net.minecraft.world.entity.boss.wither.WitherBoss#getAlternativeTarget(int)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:520
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Alternative Target

ทำงานยังไง

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

Parameters

  • int i

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

WitherBoss instance = ...;
int result = instance.getAlternativeTarget(0);

net.minecraft.world.entity.boss.wither.WitherBoss#getAmbientSound()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:137
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Ambient Sound

ทำงานยังไง

คืนค่า: SoundEvents.WITHER_AMBIENT.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#getDeathSound()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:147
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Death Sound

ทำงานยังไง

คืนค่า: SoundEvents.WITHER_DEATH.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#getHeadXRots()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:508
  • Modifiers: public
  • Return: float[]

คืออะไร

อ่านค่า Head XRots

ทำงานยังไง

คืนค่า: this.xRotHeads.

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
float[] result = instance.getHeadXRots();

net.minecraft.world.entity.boss.wither.WitherBoss#getHeadYRots()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:504
  • Modifiers: public
  • Return: float[]

คืออะไร

อ่านค่า Head YRots

ทำงานยังไง

คืนค่า: this.yRotHeads.

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
float[] result = instance.getHeadYRots();

net.minecraft.world.entity.boss.wither.WitherBoss#getHurtSound(DamageSource)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:142
  • Modifiers: protected
  • Return: SoundEvent

คืออะไร

อ่านค่า Hurt Sound

ทำงานยังไง

คืนค่า: SoundEvents.WITHER_HURT.

Parameters

  • DamageSource damageSource

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#getInvulnerableTicks()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:512
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Invulnerable Ticks

ทำงานยังไง

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

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
int result = instance.getInvulnerableTicks();

net.minecraft.world.entity.boss.wither.WitherBoss#hurtServer(ServerLevel,DamageSource,float)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:435
  • Modifiers: public
  • Return: boolean

คืออะไร

ประมวลผลความเสียหาย Server

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: destroyBlocksTick. เรียกต่อ: isInvulnerableTo(), is(), getEntity(), getInvulnerableTicks(), isPowered(), getDirectEntity(), getType(). มีจุด return อย่างน้อย 6 จุด.

Parameters

  • ServerLevel serverLevel
  • DamageSource damageSource
  • float f

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

WitherBoss instance = ...;
ServerLevel serverLevel = ...;
DamageSource damageSource = ...;
boolean result = instance.hurtServer(serverLevel, damageSource, 0.0F);

net.minecraft.world.entity.boss.wither.WitherBoss#isPowered()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:528
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

เรียกต่อ: getHealth(), getMaxHealth(). คืนค่า: this.getHealth() <= this.getMaxHealth() / 2.0F.

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
boolean result = instance.isPowered();

net.minecraft.world.entity.boss.wither.WitherBoss#makeInvulnerable()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:342
  • Modifiers: public
  • Return: void

คืออะไร

สร้าง Invulnerable

ทำงานยังไง

เรียกต่อ: setInvulnerableTicks(), setProgress(), setHealth(), getMaxHealth().

Parameters

  • ไม่มี

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

WitherBoss instance = ...;
instance.makeInvulnerable();

net.minecraft.world.entity.boss.wither.WitherBoss#makeStuckInBlock(BlockState,Vec3)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:348
  • Modifiers: public
  • Return: void

คืออะไร

สร้าง Stuck In Block

ทำงานยังไง

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

Parameters

  • BlockState blockState
  • Vec3 vec3

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

WitherBoss instance = ...;
BlockState blockState = ...;
Vec3 vec3 = ...;
instance.makeStuckInBlock(blockState, vec3);

net.minecraft.world.entity.boss.wither.WitherBoss#performRangedAttack(LivingEntity,float)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:430
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ performRangedAttack ตาม implementation ของ WitherBoss

ทำงานยังไง

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

Parameters

  • LivingEntity livingEntity
  • float f

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

WitherBoss instance = ...;
LivingEntity livingEntity = ...;
instance.performRangedAttack(livingEntity, 0.0F);

net.minecraft.world.entity.boss.wither.WitherBoss#readAdditionalSaveData(CompoundTag)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:122
  • Modifiers: public
  • Return: void

คืออะไร

อ่าน Additional Save Data

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: setInvulnerableTicks(), getInt(), hasCustomName(), setName(), getDisplayName().

Parameters

  • CompoundTag compoundTag

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#registerGoals()

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:96
  • Modifiers: protected
  • Return: void

คืออะไร

ลงทะเบียน Goals

ทำงานยังไง

เรียกต่อ: addGoal(), WitherDoNothingGoal(). สร้างออบเจ็กต์: WitherBoss.WitherDoNothingGoal, RangedAttackGoal, WaterAvoidingRandomFlyingGoal, LookAtPlayerGoal.

Parameters

  • ไม่มี

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

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

net.minecraft.world.entity.boss.wither.WitherBoss#setAlternativeTarget(int,int)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:524
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Alternative Target

ทำงานยังไง

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

Parameters

  • int i
  • int j

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

WitherBoss instance = ...;
instance.setAlternativeTarget(0, 0);

net.minecraft.world.entity.boss.wither.WitherBoss#setCustomName(Component)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:131
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Custom Name

ทำงานยังไง

เรียกต่อ: setName(), getDisplayName().

Parameters

  • Component component

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

WitherBoss instance = ...;
Component component = ...;
instance.setCustomName(component);

net.minecraft.world.entity.boss.wither.WitherBoss#setInvulnerableTicks(int)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:516
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Invulnerable Ticks

ทำงานยังไง

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

Parameters

  • int i

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

WitherBoss instance = ...;
instance.setInvulnerableTicks(0);

net.minecraft.world.entity.boss.wither.WitherBoss#startSeenByPlayer(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:352
  • Modifiers: public
  • Return: void

คืออะไร

เริ่ม Seen By Player

ทำงานยังไง

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

Parameters

  • ServerPlayer serverPlayer

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

WitherBoss instance = ...;
ServerPlayer serverPlayer = ...;
instance.startSeenByPlayer(serverPlayer);

net.minecraft.world.entity.boss.wither.WitherBoss#stopSeenByPlayer(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:358
  • Modifiers: public
  • Return: void

คืออะไร

หยุด Seen By Player

ทำงานยังไง

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

Parameters

  • ServerPlayer serverPlayer

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

WitherBoss instance = ...;
ServerPlayer serverPlayer = ...;
instance.stopSeenByPlayer(serverPlayer);

net.minecraft.world.entity.boss.wither.WitherBoss#WitherBoss(EntityType<? extends WitherBoss>,Level)

  • Origin: common
  • Source: net/minecraft/world/entity/boss/wither/WitherBoss.java:81
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: moveControl, xpReward. เรียกต่อ: setHealth(), getMaxHealth(). สร้างออบเจ็กต์: FlyingMoveControl.

Parameters

  • EntityType<? extends WitherBoss> entityType
  • Level level

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

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