Skip to content

Package net.minecraft.server.bossevents

Part 1/1


CustomBossEvent

  • Full name: net.minecraft.server.bossevents.CustomBossEvent
  • Package: net.minecraft.server.bossevents
  • Source: commonnet/minecraft/server/bossevents/CustomBossEvent.java
  • Type: class
  • Modifiers: public
  • Extends: ServerBossEvent

net.minecraft.server.bossevents.CustomBossEvent#addOfflinePlayer(UUID)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:43
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Offline Player

ทำงานยังไง

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

Parameters

  • UUID uUID

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

CustomBossEvent instance = ...;
UUID uUID = ...;
instance.addOfflinePlayer(uUID);

net.minecraft.server.bossevents.CustomBossEvent#addPlayer(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:37
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม Player

ทำงานยังไง

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

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvent instance = ...;
ServerPlayer serverPlayer = ...;
instance.addPlayer(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvent#CustomBossEvent(ResourceLocation,Component)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:27
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: id. เรียกต่อ: setProgress().

Parameters

  • ResourceLocation resourceLocation
  • Component component

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

ResourceLocation resourceLocation = ...;
Component component = ...;
CustomBossEvent instance = new CustomBossEvent(resourceLocation, component);

net.minecraft.server.bossevents.CustomBossEvent#getDisplayName()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:77
  • Modifiers: public final
  • Return: Component

คืออะไร

อ่านค่า Display Name

ทำงานยังไง

เรียกต่อ: wrapInSquareBrackets(), getName(), withStyle(), withColor(), getColor(), getFormatting(), withHoverEvent(), literal(). สร้างออบเจ็กต์: HoverEvent.

Parameters

  • ไม่มี

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

CustomBossEvent instance = ...;
Component result = instance.getDisplayName();

net.minecraft.server.bossevents.CustomBossEvent#getMax()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:63
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Max

ทำงานยังไง

คืนค่า: this.max.

Parameters

  • ไม่มี

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

CustomBossEvent instance = ...;
int result = instance.getMax();

net.minecraft.server.bossevents.CustomBossEvent#getTextId()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:33
  • Modifiers: public
  • Return: ResourceLocation

คืออะไร

อ่านค่า Text Id

ทำงานยังไง

คืนค่า: this.id.

Parameters

  • ไม่มี

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

CustomBossEvent instance = ...;
ResourceLocation result = instance.getTextId();

net.minecraft.server.bossevents.CustomBossEvent#getValue()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:59
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Value

ทำงานยังไง

คืนค่า: this.value.

Parameters

  • ไม่มี

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

CustomBossEvent instance = ...;
int result = instance.getValue();

net.minecraft.server.bossevents.CustomBossEvent#load(CompoundTag,ResourceLocation,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:159
  • Modifiers: public static
  • Return: CustomBossEvent

คืออะไร

โหลด load

ทำงานยังไง

มีการวนลูป. เรียกต่อ: fromJson(), getString(), setVisible(), getBoolean(), setValue(), getInt(), setMax(), setColor(). สร้างออบเจ็กต์: CustomBossEvent. คืนค่า: customBossEvent.

Parameters

  • CompoundTag compoundTag
  • ResourceLocation resourceLocation
  • HolderLookup.Provider provider

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

CompoundTag compoundTag = ...;
ResourceLocation resourceLocation = ...;
HolderLookup.Provider provider = ...;
CustomBossEvent result = CustomBossEvent.load(compoundTag, resourceLocation, provider);

net.minecraft.server.bossevents.CustomBossEvent#onPlayerConnect(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:177
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Player Connect

ทำงานยังไง

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

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvent instance = ...;
ServerPlayer serverPlayer = ...;
instance.onPlayerConnect(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvent#onPlayerDisconnect(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:183
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Player Disconnect

ทำงานยังไง

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

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvent instance = ...;
ServerPlayer serverPlayer = ...;
instance.onPlayerDisconnect(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvent#removeAllPlayers()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:53
  • Modifiers: public
  • Return: void

คืออะไร

ลบ All Players

ทำงานยังไง

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

Parameters

  • ไม่มี

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

CustomBossEvent instance = ...;
instance.removeAllPlayers();

net.minecraft.server.bossevents.CustomBossEvent#removePlayer(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:47
  • Modifiers: public
  • Return: void

คืออะไร

ลบ Player

ทำงานยังไง

เรียกต่อ: remove(), getUUID().

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvent instance = ...;
ServerPlayer serverPlayer = ...;
instance.removePlayer(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvent#save(HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:138
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

บันทึก save

ทำงานยังไง

มีการวนลูป. เรียกต่อ: putString(), toJson(), putBoolean(), isVisible(), putInt(), getColor(), getName(), getOverlay(). สร้างออบเจ็กต์: CompoundTag, ListTag. คืนค่า: compoundTag.

Parameters

  • HolderLookup.Provider provider

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

CustomBossEvent instance = ...;
HolderLookup.Provider provider = ...;
CompoundTag result = instance.save(provider);

net.minecraft.server.bossevents.CustomBossEvent#setMax(int)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:72
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Max

ทำงานยังไง

แก้ state: max. เรียกต่อ: setProgress(), clamp().

Parameters

  • int i

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

CustomBossEvent instance = ...;
instance.setMax(0);

net.minecraft.server.bossevents.CustomBossEvent#setPlayers(Collection<ServerPlayer>)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:86
  • Modifiers: public
  • Return: boolean

คืออะไร

กำหนดค่า Players

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newHashSet(), getUUID(), equals(), add(), getPlayers(), removePlayer(), remove(), addPlayer(). คืนค่า: !set.isEmpty() || !set2.isEmpty().

Parameters

  • Collection<ServerPlayer> collection

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

CustomBossEvent instance = ...;
Collection<ServerPlayer> collection = ...;
boolean result = instance.setPlayers(collection);

net.minecraft.server.bossevents.CustomBossEvent#setValue(int)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvent.java:67
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Value

ทำงานยังไง

แก้ state: value. เรียกต่อ: setProgress(), clamp().

Parameters

  • int i

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

CustomBossEvent instance = ...;
instance.setValue(0);

CustomBossEvents

  • Full name: net.minecraft.server.bossevents.CustomBossEvents
  • Package: net.minecraft.server.bossevents
  • Source: commonnet/minecraft/server/bossevents/CustomBossEvents.java
  • Type: class
  • Modifiers: public

net.minecraft.server.bossevents.CustomBossEvents#create(ResourceLocation,Component)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:21
  • Modifiers: public
  • Return: CustomBossEvent

คืออะไร

สร้าง create

ทำงานยังไง

เรียกต่อ: put(). สร้างออบเจ็กต์: CustomBossEvent. คืนค่า: customBossEvent.

Parameters

  • ResourceLocation resourceLocation
  • Component component

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

CustomBossEvents instance = ...;
ResourceLocation resourceLocation = ...;
Component component = ...;
CustomBossEvent result = instance.create(resourceLocation, component);

net.minecraft.server.bossevents.CustomBossEvents#get(ResourceLocation)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:16
  • Modifiers: public
  • Return: CustomBossEvent

คืออะไร

อ่านค่า get

ทำงานยังไง

คืนค่า: this.events.get(resourceLocation).

Parameters

  • ResourceLocation resourceLocation

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

CustomBossEvents instance = ...;
ResourceLocation resourceLocation = ...;
CustomBossEvent result = instance.get(resourceLocation);

net.minecraft.server.bossevents.CustomBossEvents#getEvents()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:35
  • Modifiers: public
  • Return: Collection<CustomBossEvent>

คืออะไร

อ่านค่า Events

ทำงานยังไง

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

Parameters

  • ไม่มี

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

CustomBossEvents instance = ...;
Collection<CustomBossEvent> result = instance.getEvents();

net.minecraft.server.bossevents.CustomBossEvents#getIds()

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:31
  • Modifiers: public
  • Return: Collection<ResourceLocation>

คืออะไร

อ่านค่า Ids

ทำงานยังไง

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

Parameters

  • ไม่มี

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

CustomBossEvents instance = ...;
Collection<ResourceLocation> result = instance.getIds();

net.minecraft.server.bossevents.CustomBossEvents#load(CompoundTag,HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:49
  • Modifiers: public
  • Return: void

คืออะไร

โหลด load

ทำงานยังไง

มีการวนลูป. เรียกต่อ: getAllKeys(), parse(), put(), getCompound().

Parameters

  • CompoundTag compoundTag
  • HolderLookup.Provider provider

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

CustomBossEvents instance = ...;
CompoundTag compoundTag = ...;
HolderLookup.Provider provider = ...;
instance.load(compoundTag, provider);

net.minecraft.server.bossevents.CustomBossEvents#onPlayerConnect(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:56
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Player Connect

ทำงานยังไง

มีการวนลูป. เรียกต่อ: values().

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvents instance = ...;
ServerPlayer serverPlayer = ...;
instance.onPlayerConnect(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvents#onPlayerDisconnect(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:62
  • Modifiers: public
  • Return: void

คืออะไร

จัดการเหตุการณ์ Player Disconnect

ทำงานยังไง

มีการวนลูป. เรียกต่อ: values().

Parameters

  • ServerPlayer serverPlayer

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

CustomBossEvents instance = ...;
ServerPlayer serverPlayer = ...;
instance.onPlayerDisconnect(serverPlayer);

net.minecraft.server.bossevents.CustomBossEvents#remove(CustomBossEvent)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:27
  • Modifiers: public
  • Return: void

คืออะไร

ลบ remove

ทำงานยังไง

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

Parameters

  • CustomBossEvent customBossEvent

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

CustomBossEvents instance = ...;
CustomBossEvent customBossEvent = ...;
instance.remove(customBossEvent);

net.minecraft.server.bossevents.CustomBossEvents#save(HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/server/bossevents/CustomBossEvents.java:39
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

บันทึก save

ทำงานยังไง

มีการวนลูป. เรียกต่อ: values(), put(), getTextId(), toString(). สร้างออบเจ็กต์: CompoundTag. คืนค่า: compoundTag.

Parameters

  • HolderLookup.Provider provider

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

CustomBossEvents instance = ...;
HolderLookup.Provider provider = ...;
CompoundTag result = instance.save(provider);