Package net.minecraft.world.item.component
Part 1/1
BlockItemStateProperties
- Full name:
net.minecraft.world.item.component.BlockItemStateProperties - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/BlockItemStateProperties.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.BlockItemStateProperties#apply(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/component/BlockItemStateProperties.java:42 - Modifiers:
public - Return:
BlockState
คืออะไร
นำไปใช้ apply
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBlock(), getStateDefinition(), entrySet(), getProperty(), getKey(), updateState(), getValue(). คืนค่า: blockState.
Parameters
BlockState blockState
ตัวอย่างใช้งาน
BlockItemStateProperties instance = ...;
BlockState blockState = ...;
BlockState result = instance.apply(blockState);
net.minecraft.world.item.component.BlockItemStateProperties#get(Property<T>)
- Origin:
common - Source:
net/minecraft/world/item/component/BlockItemStateProperties.java:36 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า get
ทำงานยังไง
เรียกต่อ: getName(), getValue(), orElse(). คืนค่า: string == null ? null : property.getValue(string).orElse(null).
Parameters
Property<T> property
ตัวอย่างใช้งาน
BlockItemStateProperties instance = ...;
Property<T> property = ...;
T result = instance.get(property);
net.minecraft.world.item.component.BlockItemStateProperties#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/component/BlockItemStateProperties.java:59 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.properties.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BlockItemStateProperties#with(Property<T>,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/component/BlockItemStateProperties.java:32 - Modifiers:
public - Return:
BlockItemStateProperties
คืออะไร
ดำเนินการ with ตาม implementation ของ BlockItemStateProperties
ทำงานยังไง
เรียกต่อ: getValue(). คืนค่า: this.with(property, blockState.getValue(property)).
Parameters
Property<T> propertyBlockState blockState
ตัวอย่างใช้งาน
BlockItemStateProperties instance = ...;
Property<T> property = ...;
BlockState blockState = ...;
BlockItemStateProperties result = instance.with(property, blockState);
net.minecraft.world.item.component.BlockItemStateProperties#with(Property<T>,T)
- Origin:
common - Source:
net/minecraft/world/item/component/BlockItemStateProperties.java:28 - Modifiers:
public - Return:
BlockItemStateProperties
คืออะไร
ดำเนินการ with ตาม implementation ของ BlockItemStateProperties
ทำงานยังไง
เรียกต่อ: copyAndPut(), getName(). สร้างออบเจ็กต์: BlockItemStateProperties. คืนค่า: new BlockItemStateProperties(Util.copyAndPut(this.properties, property.getName(), property.getName(comparable))).
Parameters
Property<T> propertyT comparable
ตัวอย่างใช้งาน
BlockItemStateProperties instance = ...;
Property<T> property = ...;
T comparable = ...;
BlockItemStateProperties result = instance.with(property, comparable);
BookContent
- Full name:
net.minecraft.world.item.component.BookContent - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/BookContent.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.component.BookContent#pages()
- Origin:
common - Source:
net/minecraft/world/item/component/BookContent.java:7 - Modifiers: ``
- Return:
List<Filterable<T>>
คืออะไร
ดำเนินการ pages ตาม implementation ของ BookContent
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BookContent#withReplacedPages(List<Filterable<T>>)
- Origin:
common - Source:
net/minecraft/world/item/component/BookContent.java:9 - Modifiers: ``
- Return:
C
คืออะไร
ดำเนินการ withReplacedPages ตาม implementation ของ BookContent
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
List<Filterable<T>> list
ตัวอย่างใช้งาน
BookContent instance = ...;
List<Filterable<T>> list = ...;
C result = instance.withReplacedPages(list);
BundleContents
- Full name:
net.minecraft.world.item.component.BundleContents - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/BundleContents.java - Type:
class - Modifiers:
public final - Implements:
TooltipComponent
net.minecraft.world.item.component.BundleContents#BundleContents(List<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:51 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BundleContents ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: computeContentWeight().
Parameters
List<ItemStack> list
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#canItemBeInBundle(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:75 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Item Be In Bundle
ทำงานยังไง
เรียกต่อ: isEmpty(), getItem(), canFitInsideContainerItems(). คืนค่า: !itemStack.isEmpty() && itemStack.getItem().canFitInsideContainerItems().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:123 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: listMatches(). คืนค่า: true.
Parameters
Object object
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#getItemUnsafe(int)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:87 - Modifiers:
public - Return:
ItemStack
คืออะไร
อ่านค่า Item Unsafe
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: this.items.get(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#getNumberOfItemsToShow()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:79 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Number Of Items To Show
ทำงานยังไง
เรียกต่อ: size(), min(). คืนค่า: Math.min(i, j - l).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#getSelectedItem()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:115 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Selected Item
ทำงานยังไง
คืนค่า: this.selectedItem.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:134 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ BundleContents
ทำงานยังไง
เรียกต่อ: hashStackList(). คืนค่า: ItemStack.hashStackList(this.items).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#hasSelectedItem()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:119 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Selected Item
ทำงานยังไง
คืนค่า: this.selectedItem != -1.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:111 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.items.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#itemCopyStream()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:91 - Modifiers:
public - Return:
Stream<ItemStack>
คืออะไร
ดำเนินการ itemCopyStream ตาม implementation ของ BundleContents
ทำงานยังไง
เรียกต่อ: stream(), map(). คืนค่า: this.items.stream().map(ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#items()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:95 - Modifiers:
public - Return:
Iterable<ItemStack>
คืออะไร
ดำเนินการ items ตาม implementation ของ BundleContents
ทำงานยังไง
คืนค่า: this.items.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#itemsCopy()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:99 - Modifiers:
public - Return:
Iterable<ItemStack>
คืออะไร
ดำเนินการ itemsCopy ตาม implementation ของ BundleContents
ทำงานยังไง
เรียกต่อ: transform(). คืนค่า: Lists.transform(this.items, ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#size()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:103 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ size ตาม implementation ของ BundleContents
ทำงานยังไง
คืนค่า: this.items.size().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#toString()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:139 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ BundleContents
ทำงานยังไง
คืนค่า: "BundleContents" + this.items.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents#weight()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:107 - Modifiers:
public - Return:
Fraction
คืออะไร
ดำเนินการ weight ตาม implementation ของ BundleContents
ทำงานยังไง
คืนค่า: this.weight.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
BundleContents$Mutable
- Full name:
net.minecraft.world.item.component.BundleContents$Mutable - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/BundleContents.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.component.BundleContents$Mutable#clearItems()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:155 - Modifiers:
public - Return:
BundleContents.Mutable
คืออะไร
ล้าง Items
ทำงานยังไง
แก้ state: weight, selectedItem. เรียกต่อ: clear(). คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents$Mutable#Mutable(BundleContents)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:149 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BundleContents.Mutable ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: items, weight, selectedItem. สร้างออบเจ็กต์: ArrayList<>.
Parameters
BundleContents bundleContents
ตัวอย่างใช้งาน
BundleContents bundleContents = ...;
BundleContents.Mutable instance = new BundleContents.Mutable(bundleContents);
net.minecraft.world.item.component.BundleContents$Mutable#removeOne()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:215 - Modifiers:
public - Return:
ItemStack
คืออะไร
ลบ One
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: weight. เรียกต่อ: isEmpty(), size(), remove(), copy(), subtract(), getWeight(), multiplyBy(), getFraction(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents$Mutable#toggleSelectedItem(int)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:211 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ toggleSelectedItem ตาม implementation ของ BundleContents$Mutable
ทำงานยังไง
แก้ state: selectedItem. เรียกต่อ: size().
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents$Mutable#toImmutable()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:232 - Modifiers:
public - Return:
BundleContents
คืออะไร
ดำเนินการ toImmutable ตาม implementation ของ BundleContents$Mutable
ทำงานยังไง
เรียกต่อ: copyOf(). สร้างออบเจ็กต์: BundleContents. คืนค่า: new BundleContents(List.copyOf(this.items), this.weight, this.selectedItem).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.BundleContents$Mutable#tryInsert(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:181 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ tryInsert ตาม implementation ของ BundleContents$Mutable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: weight. เรียกต่อ: canItemBeInBundle(), min(), getCount(), getMaxAmountToAdd(), add(), getWeight(), multiplyBy(), getFraction(). มีจุด return อย่างน้อย 3 จุด.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BundleContents.Mutable instance = ...;
ItemStack itemStack = ...;
int result = instance.tryInsert(itemStack);
net.minecraft.world.item.component.BundleContents$Mutable#tryTransfer(Slot,Player)
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:205 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ tryTransfer ตาม implementation ของ BundleContents$Mutable
ทำงานยังไง
เรียกต่อ: getItem(), getMaxAmountToAdd(), canItemBeInBundle(), tryInsert(), safeTake(), getCount(). คืนค่า: BundleContents.canItemBeInBundle(itemStack) ? this.tryInsert(slot.safeTake(itemStack.getCount(), i, player)) : 0.
Parameters
Slot slotPlayer player
ตัวอย่างใช้งาน
BundleContents.Mutable instance = ...;
Slot slot = ...;
Player player = ...;
int result = instance.tryTransfer(slot, player);
net.minecraft.world.item.component.BundleContents$Mutable#weight()
- Origin:
common - Source:
net/minecraft/world/item/component/BundleContents.java:228 - Modifiers:
public - Return:
Fraction
คืออะไร
ดำเนินการ weight ตาม implementation ของ BundleContents$Mutable
ทำงานยังไง
คืนค่า: this.weight.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ChargedProjectiles
- Full name:
net.minecraft.world.item.component.ChargedProjectiles - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ChargedProjectiles.java - Type:
class - Modifiers:
public final
net.minecraft.world.item.component.ChargedProjectiles#contains(Item)
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:32 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี contains
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: is(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Item item
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:50 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
เรียกต่อ: listMatches(). คืนค่า: this == object ? true : object instanceof ChargedProjectiles chargedProjectiles && ItemStack.listMatches(this.items, chargedProjectiles.items).
Parameters
Object object
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#getItems()
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:42 - Modifiers:
public - Return:
List<ItemStack>
คืออะไร
อ่านค่า Items
ทำงานยังไง
เรียกต่อ: transform(). คืนค่า: Lists.transform(this.items, ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:55 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ ChargedProjectiles
ทำงานยังไง
เรียกต่อ: hashStackList(). คืนค่า: ItemStack.hashStackList(this.items).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:46 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.items.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#of(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:24 - Modifiers:
public static - Return:
ChargedProjectiles
คืออะไร
ดำเนินการ of ตาม implementation ของ ChargedProjectiles
ทำงานยังไง
เรียกต่อ: copy(). สร้างออบเจ็กต์: ChargedProjectiles. คืนค่า: new ChargedProjectiles(List.of(itemStack.copy())).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#of(List<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:28 - Modifiers:
public static - Return:
ChargedProjectiles
คืออะไร
ดำเนินการ of ตาม implementation ของ ChargedProjectiles
ทำงานยังไง
เรียกต่อ: copyOf(), transform(). สร้างออบเจ็กต์: ChargedProjectiles. คืนค่า: new ChargedProjectiles(List.copyOf(Lists.transform(list, ItemStack::copy))).
Parameters
List<ItemStack> list
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ChargedProjectiles#toString()
- Origin:
common - Source:
net/minecraft/world/item/component/ChargedProjectiles.java:60 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ ChargedProjectiles
ทำงานยังไง
คืนค่า: "ChargedProjectiles[items=" + this.items + "]".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
Consumable
- Full name:
net.minecraft.world.item.component.Consumable - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Consumable.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.Consumable#builder()
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:128 - Modifiers:
public static - Return:
Consumable.Builder
คืออะไร
ดำเนินการ builder ตาม implementation ของ Consumable
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: Consumable.Builder. คืนค่า: new Consumable.Builder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable#canConsume(LivingEntity,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:95 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Consume
ทำงานยังไง
เรียกต่อ: get(), canEat(), canAlwaysEat(). คืนค่า: foodProperties != null && livingEntity instanceof Player player ? player.canEat(foodProperties.canAlwaysEat()) : true.
Parameters
LivingEntity livingEntityItemStack itemStack
ตัวอย่างใช้งาน
Consumable instance = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
boolean result = instance.canConsume(livingEntity, itemStack);
net.minecraft.world.item.component.Consumable#consumeTicks()
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:100 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ consumeTicks ตาม implementation ของ Consumable
ทำงานยังไง
คืนค่า: (int)(this.consumeSeconds * 20.0F).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable#emitParticlesAndSounds(RandomSource,LivingEntity,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:104 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ emitParticlesAndSounds ตาม implementation ของ Consumable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: animation. เรียกต่อ: nextBoolean(), triangle(), randomBetween(), spawnItemParticles(), getConsumeSound(), value(), playSound().
Parameters
RandomSource randomSourceLivingEntity livingEntityItemStack itemStackint i
ตัวอย่างใช้งาน
Consumable instance = ...;
RandomSource randomSource = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
instance.emitParticlesAndSounds(randomSource, livingEntity, itemStack, 0);
net.minecraft.world.item.component.Consumable#onConsume(Level,LivingEntity,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:77 - Modifiers:
public - Return:
ItemStack
คืออะไร
จัดการเหตุการณ์ Consume
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: animation. เรียกต่อ: getRandom(), emitParticlesAndSounds(), awardStat(), get(), getItem(), trigger(), getAllOfType(), forEach(). คืนค่า: itemStack.
Parameters
Level levelLivingEntity livingEntityItemStack itemStack
ตัวอย่างใช้งาน
Consumable instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
ItemStack result = instance.onConsume(level, livingEntity, itemStack);
net.minecraft.world.item.component.Consumable#shouldEmitParticlesAndSounds(int)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:121 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าควร Emit Particles And Sounds
ทำงานยังไง
เรียกต่อ: consumeTicks(). คืนค่า: bl && i % 4 == 0.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable#startConsuming(LivingEntity,ItemStack,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:62 - Modifiers:
public - Return:
InteractionResult
คืออะไร
เริ่ม Consuming
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: canConsume(), consumeTicks(), startUsingItem(), onConsume(), level(), heldItemTransformedTo(). มีจุด return อย่างน้อย 3 จุด.
Parameters
LivingEntity livingEntityItemStack itemStackInteractionHand interactionHand
ตัวอย่างใช้งาน
Consumable instance = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.startConsuming(livingEntity, itemStack, interactionHand);
Consumable$Builder
- Full name:
net.minecraft.world.item.component.Consumable$Builder - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Consumable.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.component.Consumable$Builder#animation(ItemUseAnimation)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:147 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
ดำเนินการ animation ตาม implementation ของ Consumable$Builder
ทำงานยังไง
แก้ state: animation. คืนค่า: this.
Parameters
ItemUseAnimation itemUseAnimation
ตัวอย่างใช้งาน
Consumable.Builder instance = ...;
ItemUseAnimation itemUseAnimation = ...;
Consumable.Builder result = instance.animation(itemUseAnimation);
net.minecraft.world.item.component.Consumable$Builder#build()
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:171 - Modifiers:
public - Return:
Consumable
คืออะไร
สร้าง build
ทำงานยังไง
สร้างออบเจ็กต์: Consumable. คืนค่า: new Consumable(this.consumeSeconds, this.animation, this.sound, this.hasConsumeParticles, this.onConsumeEffects).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable$Builder#consumeSeconds(float)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:142 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
ดำเนินการ consumeSeconds ตาม implementation ของ Consumable$Builder
ทำงานยังไง
แก้ state: consumeSeconds. คืนค่า: this.
Parameters
float f
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable$Builder#hasConsumeParticles(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:161 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
ตรวจสอบว่ามี Consume Particles
ทำงานยังไง
แก้ state: hasConsumeParticles. คืนค่า: this.
Parameters
boolean bl
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumable$Builder#onConsume(ConsumeEffect)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:166 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
จัดการเหตุการณ์ Consume
ทำงานยังไง
เรียกต่อ: add(). คืนค่า: this.
Parameters
ConsumeEffect consumeEffect
ตัวอย่างใช้งาน
Consumable.Builder instance = ...;
ConsumeEffect consumeEffect = ...;
Consumable.Builder result = instance.onConsume(consumeEffect);
net.minecraft.world.item.component.Consumable$Builder#sound(Holder<SoundEvent>)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:152 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
ดำเนินการ sound ตาม implementation ของ Consumable$Builder
ทำงานยังไง
แก้ state: sound. คืนค่า: this.
Parameters
Holder<SoundEvent> holder
ตัวอย่างใช้งาน
Consumable.Builder instance = ...;
Holder<SoundEvent> holder = ...;
Consumable.Builder result = instance.sound(holder);
net.minecraft.world.item.component.Consumable$Builder#soundAfterConsume(Holder<SoundEvent>)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:157 - Modifiers:
public - Return:
Consumable.Builder
คืออะไร
ดำเนินการ soundAfterConsume ตาม implementation ของ Consumable$Builder
ทำงานยังไง
เรียกต่อ: onConsume(). สร้างออบเจ็กต์: PlaySoundConsumeEffect. คืนค่า: this.onConsume(new PlaySoundConsumeEffect(holder)).
Parameters
Holder<SoundEvent> holder
ตัวอย่างใช้งาน
Consumable.Builder instance = ...;
Holder<SoundEvent> holder = ...;
Consumable.Builder result = instance.soundAfterConsume(holder);
Consumable$OverrideConsumeSound
- Full name:
net.minecraft.world.item.component.Consumable$OverrideConsumeSound - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Consumable.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.component.Consumable$OverrideConsumeSound#getConsumeSound(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/Consumable.java:177 - Modifiers: ``
- Return:
SoundEvent
คืออะไร
อ่านค่า Consume Sound
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Consumable.OverrideConsumeSound instance = ...;
ItemStack itemStack = ...;
SoundEvent result = instance.getConsumeSound(itemStack);
ConsumableListener
- Full name:
net.minecraft.world.item.component.ConsumableListener - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ConsumableListener.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.component.ConsumableListener#onConsume(Level,LivingEntity,ItemStack,Consumable)
- Origin:
common - Source:
net/minecraft/world/item/component/ConsumableListener.java:8 - Modifiers: ``
- Return:
void
คืออะไร
จัดการเหตุการณ์ Consume
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Level levelLivingEntity livingEntityItemStack itemStackConsumable consumable
ตัวอย่างใช้งาน
ConsumableListener instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
Consumable consumable = ...;
instance.onConsume(level, livingEntity, itemStack, consumable);
Consumables
- Full name:
net.minecraft.world.item.component.Consumables - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Consumables.java - Type:
class - Modifiers:
public
net.minecraft.world.item.component.Consumables#defaultDrink()
- Origin:
common - Source:
net/minecraft/world/item/component/Consumables.java:68 - Modifiers:
public static - Return:
Consumable.Builder
คืออะไร
ดำเนินการ defaultDrink ตาม implementation ของ Consumables
ทำงานยังไง
เรียกต่อ: builder(), consumeSeconds(), animation(), sound(), hasConsumeParticles(). คืนค่า: Consumable.builder().consumeSeconds(1.6F).animation(ItemUseAnimation.DRINK).sound(SoundEvents.GENERIC_DRINK).hasConsumeParticles(false).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Consumables#defaultFood()
- Origin:
common - Source:
net/minecraft/world/item/component/Consumables.java:64 - Modifiers:
public static - Return:
Consumable.Builder
คืออะไร
ดำเนินการ defaultFood ตาม implementation ของ Consumables
ทำงานยังไง
เรียกต่อ: builder(), consumeSeconds(), animation(), sound(), hasConsumeParticles(). คืนค่า: Consumable.builder().consumeSeconds(1.6F).animation(ItemUseAnimation.EAT).sound(SoundEvents.GENERIC_EAT).hasConsumeParticles(true).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
CustomData
- Full name:
net.minecraft.world.item.component.CustomData - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/CustomData.java - Type:
class - Modifiers:
public final
net.minecraft.world.item.component.CustomData#contains(String)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:159 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี contains
ทำงานยังไง
คืนค่า: this.tag.contains(string).
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#copyTag()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:155 - Modifiers:
public - Return:
CompoundTag
คืออะไร
คัดลอก Tag
ทำงานยังไง
เรียกต่อ: copy(). คืนค่า: this.tag.copy().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:163 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. มีจุด return อย่างน้อย 2 จุด.
Parameters
Object object
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#getUnsafe()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:182 - Modifiers:
public - Return:
CompoundTag
คืออะไร
อ่านค่า Unsafe
ทำงานยังไง
คืนค่า: this.tag.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:172 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ CustomData
ทำงานยังไง
คืนค่า: this.tag.hashCode().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:151 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.tag.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#itemMatcher(DataComponentType<CustomData>,CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:53 - Modifiers:
public static - Return:
Predicate<ItemStack>
คืออะไร
ดำเนินการ itemMatcher ตาม implementation ของ CustomData
ทำงานยังไง
เรียกต่อ: getOrDefault(), matchedBy(). มีจุด return อย่างน้อย 2 จุด.
Parameters
DataComponentType<CustomData> dataComponentTypeCompoundTag compoundTag
ตัวอย่างใช้งาน
DataComponentType<CustomData> dataComponentType = ...;
CompoundTag compoundTag = ...;
Predicate<ItemStack> result = CustomData.itemMatcher(dataComponentType, compoundTag);
net.minecraft.world.item.component.CustomData#loadInto(BlockEntity,HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:111 - Modifiers:
public - Return:
boolean
คืออะไร
โหลด Into
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. เรียกต่อ: saveCustomOnly(), copy(), merge(), equals(), loadCustomOnly(), setChanged(), warn(), getBlockPos(). มีจุด return อย่างน้อย 2 จุด.
Parameters
BlockEntity blockEntityHolderLookup.Provider provider
ตัวอย่างใช้งาน
CustomData instance = ...;
BlockEntity blockEntity = ...;
HolderLookup.Provider provider = ...;
boolean result = instance.loadInto(blockEntity, provider);
net.minecraft.world.item.component.CustomData#loadInto(Entity)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:103 - Modifiers:
public - Return:
void
คืออะไร
โหลด Into
ทำงานยังไง
เรียกต่อ: saveWithoutId(), getUUID(), merge(), load(), setUUID(). สร้างออบเจ็กต์: CompoundTag.
Parameters
Entity entity
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#matchedBy(CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:60 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ matchedBy ตาม implementation ของ CustomData
ทำงานยังไง
เรียกต่อ: compareNbt(). คืนค่า: NbtUtils.compareNbt(compoundTag, this.tag, true).
Parameters
CompoundTag compoundTag
ตัวอย่างใช้งาน
CustomData instance = ...;
CompoundTag compoundTag = ...;
boolean result = instance.matchedBy(compoundTag);
net.minecraft.world.item.component.CustomData#of(CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:49 - Modifiers:
public static - Return:
CustomData
คืออะไร
ดำเนินการ of ตาม implementation ของ CustomData
ทำงานยังไง
เรียกต่อ: copy(). สร้างออบเจ็กต์: CustomData. คืนค่า: new CustomData(compoundTag.copy()).
Parameters
CompoundTag compoundTag
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#parseEntityId()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:87 - Modifiers:
public - Return:
ResourceLocation
คืออะไร
แปลง/วิเคราะห์ข้อมูล Entity Id
ทำงานยังไง
เรียกต่อ: contains(), tryParse(), getString(). คืนค่า: !this.tag.contains("id", 8) ? null : ResourceLocation.tryParse(this.tag.getString("id")).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#parseEntityType(HolderLookup.Provider,ResourceKey<? extends Registry<T>>)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:92 - Modifiers:
public - Return:
T
คืออะไร
แปลง/วิเคราะห์ข้อมูล Entity Type
ทำงานยังไง
เรียกต่อ: parseEntityId(), lookup(), flatMap(), get(), create(), map(), orElse().
Parameters
HolderLookup.Provider providerResourceKey<? extends Registry<T>> resourceKey
ตัวอย่างใช้งาน
CustomData instance = ...;
HolderLookup.Provider provider = ...;
ResourceKey<? extends Registry<T>> resourceKey = ...;
T result = instance.parseEntityType(provider, resourceKey);
net.minecraft.world.item.component.CustomData#read(DynamicOps<Tag>,MapDecoder<T>)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:142 - Modifiers:
public - Return:
DataResult<T>
คืออะไร
อ่าน read
ทำงานยังไง
เรียกต่อ: getMap(), getOrThrow(), decode(). คืนค่า: mapDecoder.decode(dynamicOps, mapLike).
Parameters
DynamicOps<Tag> dynamicOpsMapDecoder<T> mapDecoder
ตัวอย่างใช้งาน
CustomData instance = ...;
DynamicOps<Tag> dynamicOps = ...;
MapDecoder<T> mapDecoder = ...;
DataResult<T> result = instance.read(dynamicOps, mapDecoder);
net.minecraft.world.item.component.CustomData#read(MapDecoder<T>)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:138 - Modifiers:
public - Return:
DataResult<T>
คืออะไร
อ่าน read
ทำงานยังไง
คืนค่า: this.read(NbtOps.INSTANCE, mapDecoder).
Parameters
MapDecoder<T> mapDecoder
ตัวอย่างใช้งาน
CustomData instance = ...;
MapDecoder<T> mapDecoder = ...;
DataResult<T> result = instance.read(mapDecoder);
net.minecraft.world.item.component.CustomData#set(DataComponentType<CustomData>,ItemStack,CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:73 - Modifiers:
public static - Return:
void
คืออะไร
กำหนดค่า set
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), of(), remove().
Parameters
DataComponentType<CustomData> dataComponentTypeItemStack itemStackCompoundTag compoundTag
ตัวอย่างใช้งาน
DataComponentType<CustomData> dataComponentType = ...;
ItemStack itemStack = ...;
CompoundTag compoundTag = ...;
CustomData.set(dataComponentType, itemStack, compoundTag);
net.minecraft.world.item.component.CustomData#size()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:147 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ size ตาม implementation ของ CustomData
ทำงานยังไง
คืนค่า: this.tag.size().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#toString()
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:177 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ CustomData
ทำงานยังไง
คืนค่า: this.tag.toString().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomData#update(Consumer<CompoundTag>)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:81 - Modifiers:
public - Return:
CustomData
คืออะไร
อัปเดต update
ทำงานยังไง
เรียกต่อ: copy(), accept(). สร้างออบเจ็กต์: CustomData. คืนค่า: new CustomData(compoundTag).
Parameters
Consumer<CompoundTag> consumer
ตัวอย่างใช้งาน
CustomData instance = ...;
Consumer<CompoundTag> consumer = ...;
CustomData result = instance.update(consumer);
net.minecraft.world.item.component.CustomData#update(DataComponentType<CustomData>,ItemStack,Consumer<CompoundTag>)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:64 - Modifiers:
public static - Return:
void
คืออะไร
อัปเดต update
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getOrDefault(), isEmpty(), remove(), set().
Parameters
DataComponentType<CustomData> dataComponentTypeItemStack itemStackConsumer<CompoundTag> consumer
ตัวอย่างใช้งาน
DataComponentType<CustomData> dataComponentType = ...;
ItemStack itemStack = ...;
Consumer<CompoundTag> consumer = ...;
CustomData.update(dataComponentType, itemStack, consumer);
net.minecraft.world.item.component.CustomData#update(DynamicOps<Tag>,MapEncoder<T>,T)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomData.java:134 - Modifiers:
public - Return:
DataResult<CustomData>
คืออะไร
อัปเดต update
ทำงานยังไง
เรียกต่อ: encode(), mapBuilder(), build(), map(). สร้างออบเจ็กต์: CustomData. คืนค่า: mapEncoder.encode(object, dynamicOps, dynamicOps.mapBuilder()).build(this.tag).map(tag -> new CustomData((CompoundTag)tag)).
Parameters
DynamicOps<Tag> dynamicOpsMapEncoder<T> mapEncoderT object
ตัวอย่างใช้งาน
CustomData instance = ...;
DynamicOps<Tag> dynamicOps = ...;
MapEncoder<T> mapEncoder = ...;
T object = ...;
DataResult<CustomData> result = instance.update(dynamicOps, mapEncoder, object);
CustomModelData
- Full name:
net.minecraft.world.item.component.CustomModelData - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/CustomModelData.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.CustomModelData#getBoolean(int)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomModelData.java:45 - Modifiers:
public - Return:
Boolean
คืออะไร
อ่านค่า Boolean
ทำงานยังไง
เรียกต่อ: getSafe(). คืนค่า: getSafe(this.flags, i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomModelData#getColor(int)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomModelData.java:55 - Modifiers:
public - Return:
Integer
คืออะไร
อ่านค่า Color
ทำงานยังไง
เรียกต่อ: getSafe(). คืนค่า: getSafe(this.colors, i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomModelData#getFloat(int)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomModelData.java:40 - Modifiers:
public - Return:
Float
คืออะไร
อ่านค่า Float
ทำงานยังไง
เรียกต่อ: getSafe(). คืนค่า: getSafe(this.floats, i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.CustomModelData#getString(int)
- Origin:
common - Source:
net/minecraft/world/item/component/CustomModelData.java:50 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า String
ทำงานยังไง
เรียกต่อ: getSafe(). คืนค่า: getSafe(this.strings, i).
Parameters
int i
ตัวอย่างใช้งาน
DamageResistant
- Full name:
net.minecraft.world.item.component.DamageResistant - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/DamageResistant.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.DamageResistant#isResistantTo(DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/component/DamageResistant.java:21 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Resistant To
ทำงานยังไง
เรียกต่อ: is(). คืนค่า: damageSource.is(this.types).
Parameters
DamageSource damageSource
ตัวอย่างใช้งาน
DamageResistant instance = ...;
DamageSource damageSource = ...;
boolean result = instance.isResistantTo(damageSource);
DeathProtection
- Full name:
net.minecraft.world.item.component.DeathProtection - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/DeathProtection.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.DeathProtection#applyEffects(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/component/DeathProtection.java:38 - Modifiers:
public - Return:
void
คืออะไร
นำไปใช้ Effects
ทำงานยังไง
มีการวนลูป. เรียกต่อ: apply(), level().
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
DeathProtection instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
instance.applyEffects(itemStack, livingEntity);
DebugStickState
- Full name:
net.minecraft.world.item.component.DebugStickState - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/DebugStickState.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.DebugStickState#withProperty(Holder<Block>,Property<?>)
- Origin:
common - Source:
net/minecraft/world/item/component/DebugStickState.java:22 - Modifiers:
public - Return:
DebugStickState
คืออะไร
ดำเนินการ withProperty ตาม implementation ของ DebugStickState
ทำงานยังไง
เรียกต่อ: copyAndPut(). สร้างออบเจ็กต์: DebugStickState. คืนค่า: new DebugStickState(Util.copyAndPut(this.properties, holder, property)).
Parameters
Holder<Block> holderProperty<?> property
ตัวอย่างใช้งาน
DebugStickState instance = ...;
Holder<Block> holder = ...;
Property<?> property = ...;
DebugStickState result = instance.withProperty(holder, property);
DyedItemColor
- Full name:
net.minecraft.world.item.component.DyedItemColor - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/DyedItemColor.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.component.DyedItemColor#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/DyedItemColor.java:88 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isAdvanced(), accept(), translatable(), format(), withStyle().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
DyedItemColor instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.DyedItemColor#applyDyes(ItemStack,List<DyeItem>)
- Origin:
common - Source:
net/minecraft/world/item/component/DyedItemColor.java:39 - Modifiers:
public static - Return:
ItemStack
คืออะไร
นำไปใช้ Dyes
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: is(), copyWithCount(), get(), red(), rgb(), green(), blue(), max(). สร้างออบเจ็กต์: DyedItemColor. มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackList<DyeItem> list
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
List<DyeItem> list = ...;
ItemStack result = DyedItemColor.applyDyes(itemStack, list);
net.minecraft.world.item.component.DyedItemColor#getOrDefault(ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/component/DyedItemColor.java:34 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Or Default
ทำงานยังไง
เรียกต่อ: get(), opaque(), rgb(). คืนค่า: dyedItemColor != null ? ARGB.opaque(dyedItemColor.rgb()) : i.
Parameters
ItemStack itemStackint i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.DyedItemColor#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/DyedItemColor.java:99 - Modifiers:
public - Return:
DyedItemColor
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ DyedItemColor
ทำงานยังไง
สร้างออบเจ็กต์: DyedItemColor. คืนค่า: new DyedItemColor(this.rgb, bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
FireworkExplosion
- Full name:
net.minecraft.world.item.component.FireworkExplosion - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/FireworkExplosion.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.component.FireworkExplosion#addAdditionalTooltip(Consumer<Component>)
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:65 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Additional Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), accept(), appendColors(), empty(), withStyle(), translatable(), append().
Parameters
Consumer<Component> consumer
ตัวอย่างใช้งาน
FireworkExplosion instance = ...;
Consumer<Component> consumer = ...;
instance.addAdditionalTooltip(consumer);
net.minecraft.world.item.component.FireworkExplosion#addShapeNameTooltip(Consumer<Component>)
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:61 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Shape Name Tooltip
ทำงานยังไง
เรียกต่อ: accept(), getName(), withStyle().
Parameters
Consumer<Component> consumer
ตัวอย่างใช้งาน
FireworkExplosion instance = ...;
Consumer<Component> consumer = ...;
instance.addShapeNameTooltip(consumer);
net.minecraft.world.item.component.FireworkExplosion#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:55 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
เรียกต่อ: addShapeNameTooltip(), addAdditionalTooltip().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
FireworkExplosion instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.FireworkExplosion#withFadeColors(IntList)
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:102 - Modifiers:
public - Return:
FireworkExplosion
คืออะไร
ดำเนินการ withFadeColors ตาม implementation ของ FireworkExplosion
ทำงานยังไง
สร้างออบเจ็กต์: FireworkExplosion, IntArrayList. คืนค่า: new FireworkExplosion(this.shape, this.colors, new IntArrayList(intList), this.hasTrail, this.hasTwinkle).
Parameters
IntList intList
ตัวอย่างใช้งาน
FireworkExplosion instance = ...;
IntList intList = ...;
FireworkExplosion result = instance.withFadeColors(intList);
FireworkExplosion$Shape
- Full name:
net.minecraft.world.item.component.FireworkExplosion$Shape - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/FireworkExplosion.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.component.FireworkExplosion$Shape#byId(int)
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:134 - Modifiers:
public static - Return:
FireworkExplosion.Shape
คืออะไร
ดำเนินการ byId ตาม implementation ของ FireworkExplosion$Shape
ทำงานยังไง
เรียกต่อ: apply(). คืนค่า: BY_ID.apply(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.component.FireworkExplosion$Shape#getId()
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:130 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Id
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.FireworkExplosion$Shape#getName()
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:126 - Modifiers:
public - Return:
MutableComponent
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: translatable(). คืนค่า: Component.translatable("item.minecraft.firework_star.shape." + this.name).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.FireworkExplosion$Shape#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/component/FireworkExplosion.java:138 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
Fireworks
- Full name:
net.minecraft.world.item.component.Fireworks - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Fireworks.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.component.Fireworks#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/Fireworks.java:36 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: accept(), translatable(), append(), valueOf(), withStyle(), addShapeNameTooltip(), addAdditionalTooltip(), literal().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
Fireworks instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.Fireworks#Fireworks(int,List<FireworkExplosion>)
- Origin:
common - Source:
net/minecraft/world/item/component/Fireworks.java:30 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ Fireworks ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: size(). สร้างออบเจ็กต์: IllegalArgumentException.
Parameters
int flightDurationList<FireworkExplosion> explosions
ตัวอย่างใช้งาน
ItemAttributeModifiers
- Full name:
net.minecraft.world.item.component.ItemAttributeModifiers - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ItemAttributeModifiers.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.ItemAttributeModifiers#builder()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:49 - Modifiers:
public static - Return:
ItemAttributeModifiers.Builder
คืออะไร
ดำเนินการ builder ตาม implementation ของ ItemAttributeModifiers
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: ItemAttributeModifiers.Builder. คืนค่า: new ItemAttributeModifiers.Builder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemAttributeModifiers#compute(double,EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:82 - Modifiers:
public - Return:
double
คืออะไร
คำนวณ compute
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch ; มีการวนลูป. เรียกต่อ: test(), amount(), operation(). คืนค่า: e.
Parameters
double dEquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
ItemAttributeModifiers instance = ...;
EquipmentSlot equipmentSlot = ...;
double result = instance.compute(0.0D, equipmentSlot);
net.minecraft.world.item.component.ItemAttributeModifiers#forEach(EquipmentSlot,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:74 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ forEach ตาม implementation ของ ItemAttributeModifiers
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: test(), accept().
Parameters
EquipmentSlot equipmentSlotBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemAttributeModifiers instance = ...;
EquipmentSlot equipmentSlot = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
instance.forEach(equipmentSlot, biConsumer);
net.minecraft.world.item.component.ItemAttributeModifiers#forEach(EquipmentSlotGroup,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:66 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ forEach ตาม implementation ของ ItemAttributeModifiers
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: equals(), accept().
Parameters
EquipmentSlotGroup equipmentSlotGroupBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemAttributeModifiers instance = ...;
EquipmentSlotGroup equipmentSlotGroup = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
instance.forEach(equipmentSlotGroup, biConsumer);
net.minecraft.world.item.component.ItemAttributeModifiers#withModifierAdded(Holder<Attribute>,AttributeModifier,EquipmentSlotGroup)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:53 - Modifiers:
public - Return:
ItemAttributeModifiers
คืออะไร
ดำเนินการ withModifierAdded ตาม implementation ของ ItemAttributeModifiers
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: builderWithExpectedSize(), size(), matches(), id(), add(), Entry(), build(). สร้างออบเจ็กต์: ItemAttributeModifiers.Entry, ItemAttributeModifiers. คืนค่า: new ItemAttributeModifiers(builder.build(), this.showInTooltip).
Parameters
Holder<Attribute> holderAttributeModifier attributeModifierEquipmentSlotGroup equipmentSlotGroup
ตัวอย่างใช้งาน
ItemAttributeModifiers instance = ...;
Holder<Attribute> holder = ...;
AttributeModifier attributeModifier = ...;
EquipmentSlotGroup equipmentSlotGroup = ...;
ItemAttributeModifiers result = instance.withModifierAdded(holder, attributeModifier, equipmentSlotGroup);
net.minecraft.world.item.component.ItemAttributeModifiers#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:45 - Modifiers:
public - Return:
ItemAttributeModifiers
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ ItemAttributeModifiers
ทำงานยังไง
สร้างออบเจ็กต์: ItemAttributeModifiers. คืนค่า: new ItemAttributeModifiers(this.modifiers, bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
ItemAttributeModifiers$Builder
- Full name:
net.minecraft.world.item.component.ItemAttributeModifiers$Builder - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ItemAttributeModifiers.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.component.ItemAttributeModifiers$Builder#add(Holder<Attribute>,AttributeModifier,EquipmentSlotGroup)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:106 - Modifiers:
public - Return:
ItemAttributeModifiers.Builder
คืออะไร
เพิ่ม add
ทำงานยังไง
เรียกต่อ: Entry(). สร้างออบเจ็กต์: ItemAttributeModifiers.Entry. คืนค่า: this.
Parameters
Holder<Attribute> holderAttributeModifier attributeModifierEquipmentSlotGroup equipmentSlotGroup
ตัวอย่างใช้งาน
ItemAttributeModifiers.Builder instance = ...;
Holder<Attribute> holder = ...;
AttributeModifier attributeModifier = ...;
EquipmentSlotGroup equipmentSlotGroup = ...;
ItemAttributeModifiers.Builder result = instance.add(holder, attributeModifier, equipmentSlotGroup);
net.minecraft.world.item.component.ItemAttributeModifiers$Builder#build()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:111 - Modifiers:
public - Return:
ItemAttributeModifiers
คืออะไร
สร้าง build
ทำงานยังไง
สร้างออบเจ็กต์: ItemAttributeModifiers. คืนค่า: new ItemAttributeModifiers(this.entries.build(), true).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemAttributeModifiers$Entry
- Full name:
net.minecraft.world.item.component.ItemAttributeModifiers$Entry - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ItemAttributeModifiers.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.ItemAttributeModifiers$Entry#matches(Holder<Attribute>,ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemAttributeModifiers.java:135 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ matches ตาม implementation ของ ItemAttributeModifiers$Entry
ทำงานยังไง
เรียกต่อ: equals(), is(). คืนค่า: holder.equals(this.attribute) && this.modifier.is(resourceLocation).
Parameters
Holder<Attribute> holderResourceLocation resourceLocation
ตัวอย่างใช้งาน
ItemAttributeModifiers.Entry instance = ...;
Holder<Attribute> holder = ...;
ResourceLocation resourceLocation = ...;
boolean result = instance.matches(holder, resourceLocation);
ItemContainerContents
- Full name:
net.minecraft.world.item.component.ItemContainerContents - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ItemContainerContents.java - Type:
class - Modifiers:
public final
net.minecraft.world.item.component.ItemContainerContents#copyInto(NonNullList<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:103 - Modifiers:
public - Return:
void
คืออะไร
คัดลอก Into
ทำงานยังไง
มีการวนลูป. เรียกต่อ: size(), get(), set(), copy().
Parameters
NonNullList<ItemStack> nonNullList
ตัวอย่างใช้งาน
ItemContainerContents instance = ...;
NonNullList<ItemStack> nonNullList = ...;
instance.copyInto(nonNullList);
net.minecraft.world.item.component.ItemContainerContents#copyOne()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:110 - Modifiers:
public - Return:
ItemStack
คืออะไร
คัดลอก One
ทำงานยังไง
เรียกต่อ: isEmpty(), get(), copy(). คืนค่า: this.items.isEmpty() ? ItemStack.EMPTY : this.items.get(0).copy().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:130 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
เรียกต่อ: listMatches(). คืนค่า: this == object ? true : object instanceof ItemContainerContents itemContainerContents && ItemStack.listMatches(this.items, itemContainerContents.items).
Parameters
Object object
ตัวอย่างใช้งาน
ItemContainerContents instance = ...;
Object object = ...;
boolean result = instance.equals(object);
net.minecraft.world.item.component.ItemContainerContents#fromItems(List<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:65 - Modifiers:
public static - Return:
ItemContainerContents
คืออะไร
ดำเนินการ fromItems ตาม implementation ของ ItemContainerContents
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: findLastNonEmptySlot(), set(), get(), copy(). สร้างออบเจ็กต์: ItemContainerContents. มีจุด return อย่างน้อย 2 จุด.
Parameters
List<ItemStack> list
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:137 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ ItemContainerContents
ทำงานยังไง
คืนค่า: this.hashCode.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#nonEmptyItems()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:122 - Modifiers:
public - Return:
Iterable<ItemStack>
คืออะไร
ดำเนินการ nonEmptyItems ตาม implementation ของ ItemContainerContents
ทำงานยังไง
เรียกต่อ: filter(), isEmpty(). คืนค่า: Iterables.filter(this.items, itemStack -> !itemStack.isEmpty()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#nonEmptyItemsCopy()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:126 - Modifiers:
public - Return:
Iterable<ItemStack>
คืออะไร
ดำเนินการ nonEmptyItemsCopy ตาม implementation ของ ItemContainerContents
ทำงานยังไง
เรียกต่อ: transform(), nonEmptyItems(). คืนค่า: Iterables.transform(this.nonEmptyItems(), ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#nonEmptyStream()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:118 - Modifiers:
public - Return:
Stream<ItemStack>
คืออะไร
ดำเนินการ nonEmptyStream ตาม implementation ของ ItemContainerContents
ทำงานยังไง
เรียกต่อ: stream(), filter(), isEmpty(), map(). คืนค่า: this.items.stream().filter(itemStack -> !itemStack.isEmpty()).map(ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemContainerContents#stream()
- Origin:
common - Source:
net/minecraft/world/item/component/ItemContainerContents.java:114 - Modifiers:
public - Return:
Stream<ItemStack>
คืออะไร
ดำเนินการ stream ตาม implementation ของ ItemContainerContents
ทำงานยังไง
เรียกต่อ: map(). คืนค่า: this.items.stream().map(ItemStack::copy).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemLore
- Full name:
net.minecraft.world.item.component.ItemLore - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ItemLore.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.component.ItemLore#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemLore.java:42 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
เรียกต่อ: forEach().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
ItemLore instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.ItemLore#ItemLore(List<Component>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemLore.java:28 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemLore ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: transform(), mergeStyles(), copy().
Parameters
List<Component> list
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ItemLore#ItemLore(List<Component>,List<Component>)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemLore.java:32 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemLore ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: size(). สร้างออบเจ็กต์: IllegalArgumentException.
Parameters
List<Component> linesList<Component> styledLines
ตัวอย่างใช้งาน
List<Component> lines = ...;
List<Component> styledLines = ...;
ItemLore instance = new ItemLore(lines, styledLines);
net.minecraft.world.item.component.ItemLore#withLineAdded(Component)
- Origin:
common - Source:
net/minecraft/world/item/component/ItemLore.java:38 - Modifiers:
public - Return:
ItemLore
คืออะไร
ดำเนินการ withLineAdded ตาม implementation ของ ItemLore
ทำงานยังไง
เรียกต่อ: copyAndAdd(). สร้างออบเจ็กต์: ItemLore. คืนค่า: new ItemLore(Util.copyAndAdd(this.lines, component)).
Parameters
Component component
ตัวอย่างใช้งาน
ItemLore instance = ...;
Component component = ...;
ItemLore result = instance.withLineAdded(component);
LodestoneTracker
- Full name:
net.minecraft.world.item.component.LodestoneTracker - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/LodestoneTracker.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.LodestoneTracker#tick(ServerLevel)
- Origin:
common - Source:
net/minecraft/world/item/component/LodestoneTracker.java:26 - Modifiers:
public - Return:
LodestoneTracker
คืออะไร
ประมวลผล tick tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), get(), dimension(), pos(), isInWorldBounds(), getPoiManager(), existsAtPosition(), empty(). สร้างออบเจ็กต์: LodestoneTracker. มีจุด return อย่างน้อย 2 จุด.
Parameters
ServerLevel serverLevel
ตัวอย่างใช้งาน
LodestoneTracker instance = ...;
ServerLevel serverLevel = ...;
LodestoneTracker result = instance.tick(serverLevel);
MapDecorations
- Full name:
net.minecraft.world.item.component.MapDecorations - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/MapDecorations.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.MapDecorations#withDecoration(String,MapDecorations.Entry)
- Origin:
common - Source:
net/minecraft/world/item/component/MapDecorations.java:15 - Modifiers:
public - Return:
MapDecorations
คืออะไร
ดำเนินการ withDecoration ตาม implementation ของ MapDecorations
ทำงานยังไง
เรียกต่อ: copyAndPut(). สร้างออบเจ็กต์: MapDecorations. คืนค่า: new MapDecorations(Util.copyAndPut(this.decorations, string, entry)).
Parameters
String stringMapDecorations.Entry entry
ตัวอย่างใช้งาน
MapDecorations instance = ...;
MapDecorations.Entry entry = ...;
MapDecorations result = instance.withDecoration("value", entry);
MapPostProcessing
- Full name:
net.minecraft.world.item.component.MapPostProcessing - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/MapPostProcessing.java - Type:
enum - Modifiers:
public
net.minecraft.world.item.component.MapPostProcessing#id()
- Origin:
common - Source:
net/minecraft/world/item/component/MapPostProcessing.java:21 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ id ตาม implementation ของ MapPostProcessing
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
OminousBottleAmplifier
- Full name:
net.minecraft.world.item.component.OminousBottleAmplifier - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/OminousBottleAmplifier.java - Type:
record - Modifiers:
public - Implements:
ConsumableListener,TooltipProvider
net.minecraft.world.item.component.OminousBottleAmplifier#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/OminousBottleAmplifier.java:34 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
เรียกต่อ: of(), addPotionTooltip(), tickRate(). สร้างออบเจ็กต์: MobEffectInstance.
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
OminousBottleAmplifier instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.OminousBottleAmplifier#onConsume(Level,LivingEntity,ItemStack,Consumable)
- Origin:
common - Source:
net/minecraft/world/item/component/OminousBottleAmplifier.java:29 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Consume
ทำงานยังไง
เรียกต่อ: addEffect(). สร้างออบเจ็กต์: MobEffectInstance.
Parameters
Level levelLivingEntity livingEntityItemStack itemStackConsumable consumable
ตัวอย่างใช้งาน
OminousBottleAmplifier instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
Consumable consumable = ...;
instance.onConsume(level, livingEntity, itemStack, consumable);
ResolvableProfile
- Full name:
net.minecraft.world.item.component.ResolvableProfile - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/ResolvableProfile.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.ResolvableProfile#isResolved()
- Origin:
common - Source:
net/minecraft/world/item/component/ResolvableProfile.java:68 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Resolved
ทำงานยังไง
เรียกต่อ: isEmpty(), isPresent(). คืนค่า: !this.properties.isEmpty() ? true : this.id.isPresent() == this.name.isPresent().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ResolvableProfile#ResolvableProfile(GameProfile)
- Origin:
common - Source:
net/minecraft/world/item/component/ResolvableProfile.java:44 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ResolvableProfile ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: of(), getName(), getId(), getProperties().
Parameters
GameProfile gameProfile
ตัวอย่างใช้งาน
net.minecraft.world.item.component.ResolvableProfile#ResolvableProfile(Optional<String>,Optional<UUID>,PropertyMap)
- Origin:
common - Source:
net/minecraft/world/item/component/ResolvableProfile.java:40 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ResolvableProfile ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: createProfile().
Parameters
Optional<String> optionalOptional<UUID> optional2PropertyMap propertyMap
ตัวอย่างใช้งาน
Optional<String> optional = ...;
Optional<UUID> optional2 = ...;
PropertyMap propertyMap = ...;
ResolvableProfile instance = new ResolvableProfile(optional, optional2, propertyMap);
net.minecraft.world.item.component.ResolvableProfile#resolve()
- Origin:
common - Source:
net/minecraft/world/item/component/ResolvableProfile.java:48 - Modifiers:
public - Return:
CompletableFuture<ResolvableProfile>
คืออะไร
ดำเนินการ resolve ตาม implementation ของ ResolvableProfile
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isResolved(), completedFuture(), isPresent(), fetchGameProfile(), get(), thenApply(), orElseGet(), orElse(). สร้างออบเจ็กต์: GameProfile, ResolvableProfile. มีจุด return อย่างน้อย 3 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
SuspiciousStewEffects
- Full name:
net.minecraft.world.item.component.SuspiciousStewEffects - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/SuspiciousStewEffects.java - Type:
record - Modifiers:
public - Implements:
ConsumableListener,TooltipProvider
net.minecraft.world.item.component.SuspiciousStewEffects#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/SuspiciousStewEffects.java:44 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: isCreative(), add(), createEffectInstance(), addPotionTooltip(), tickRate(). สร้างออบเจ็กต์: ArrayList<>.
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
SuspiciousStewEffects instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.SuspiciousStewEffects#onConsume(Level,LivingEntity,ItemStack,Consumable)
- Origin:
common - Source:
net/minecraft/world/item/component/SuspiciousStewEffects.java:37 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Consume
ทำงานยังไง
มีการวนลูป. เรียกต่อ: addEffect(), createEffectInstance().
Parameters
Level levelLivingEntity livingEntityItemStack itemStackConsumable consumable
ตัวอย่างใช้งาน
SuspiciousStewEffects instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
Consumable consumable = ...;
instance.onConsume(level, livingEntity, itemStack, consumable);
net.minecraft.world.item.component.SuspiciousStewEffects#withEffectAdded(SuspiciousStewEffects.Entry)
- Origin:
common - Source:
net/minecraft/world/item/component/SuspiciousStewEffects.java:33 - Modifiers:
public - Return:
SuspiciousStewEffects
คืออะไร
ดำเนินการ withEffectAdded ตาม implementation ของ SuspiciousStewEffects
ทำงานยังไง
เรียกต่อ: copyAndAdd(). สร้างออบเจ็กต์: SuspiciousStewEffects. คืนค่า: new SuspiciousStewEffects(Util.copyAndAdd(this.effects, entry)).
Parameters
SuspiciousStewEffects.Entry entry
ตัวอย่างใช้งาน
SuspiciousStewEffects instance = ...;
SuspiciousStewEffects.Entry entry = ...;
SuspiciousStewEffects result = instance.withEffectAdded(entry);
SuspiciousStewEffects$Entry
- Full name:
net.minecraft.world.item.component.SuspiciousStewEffects$Entry - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/SuspiciousStewEffects.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.SuspiciousStewEffects$Entry#createEffectInstance()
- Origin:
common - Source:
net/minecraft/world/item/component/SuspiciousStewEffects.java:69 - Modifiers:
public - Return:
MobEffectInstance
คืออะไร
สร้าง Effect Instance
ทำงานยังไง
สร้างออบเจ็กต์: MobEffectInstance. คืนค่า: new MobEffectInstance(this.effect, this.duration).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
SuspiciousStewEffects.Entry instance = ...;
MobEffectInstance result = instance.createEffectInstance();
Tool
- Full name:
net.minecraft.world.item.component.Tool - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Tool.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.Tool#getMiningSpeed(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/component/Tool.java:36 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Mining Speed
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: isPresent(), is(), get(). มีจุด return อย่างน้อย 2 จุด.
Parameters
BlockState blockState
ตัวอย่างใช้งาน
Tool instance = ...;
BlockState blockState = ...;
float result = instance.getMiningSpeed(blockState);
net.minecraft.world.item.component.Tool#isCorrectForDrops(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/component/Tool.java:46 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Correct For Drops
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: isPresent(), is(), get(). มีจุด return อย่างน้อย 2 จุด.
Parameters
BlockState blockState
ตัวอย่างใช้งาน
Tool instance = ...;
BlockState blockState = ...;
boolean result = instance.isCorrectForDrops(blockState);
Tool$Rule
- Full name:
net.minecraft.world.item.component.Tool$Rule - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Tool.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.Tool$Rule#deniesDrops(HolderSet<Block>)
- Origin:
common - Source:
net/minecraft/world/item/component/Tool.java:79 - Modifiers:
public static - Return:
Tool.Rule
คืออะไร
ดำเนินการ deniesDrops ตาม implementation ของ Tool$Rule
ทำงานยังไง
เรียกต่อ: Rule(), empty(), of(). สร้างออบเจ็กต์: Tool.Rule. คืนค่า: new Tool.Rule(holderSet, Optional.empty(), Optional.of(false)).
Parameters
HolderSet<Block> holderSet
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Tool$Rule#minesAndDrops(HolderSet<Block>,float)
- Origin:
common - Source:
net/minecraft/world/item/component/Tool.java:75 - Modifiers:
public static - Return:
Tool.Rule
คืออะไร
ดำเนินการ minesAndDrops ตาม implementation ของ Tool$Rule
ทำงานยังไง
เรียกต่อ: Rule(), of(). สร้างออบเจ็กต์: Tool.Rule. คืนค่า: new Tool.Rule(holderSet, Optional.of(f), Optional.of(true)).
Parameters
HolderSet<Block> holderSetfloat f
ตัวอย่างใช้งาน
net.minecraft.world.item.component.Tool$Rule#overrideSpeed(HolderSet<Block>,float)
- Origin:
common - Source:
net/minecraft/world/item/component/Tool.java:83 - Modifiers:
public static - Return:
Tool.Rule
คืออะไร
ดำเนินการ overrideSpeed ตาม implementation ของ Tool$Rule
ทำงานยังไง
เรียกต่อ: Rule(), of(), empty(). สร้างออบเจ็กต์: Tool.Rule. คืนค่า: new Tool.Rule(holderSet, Optional.of(f), Optional.empty()).
Parameters
HolderSet<Block> holderSetfloat f
ตัวอย่างใช้งาน
TooltipProvider
- Full name:
net.minecraft.world.item.component.TooltipProvider - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/TooltipProvider.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.component.TooltipProvider#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/TooltipProvider.java:9 - Modifiers: ``
- Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
TooltipProvider instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
Unbreakable
- Full name:
net.minecraft.world.item.component.Unbreakable - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/Unbreakable.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.component.Unbreakable#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/component/Unbreakable.java:21 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: accept().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
Unbreakable instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.component.Unbreakable#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/Unbreakable.java:28 - Modifiers:
public - Return:
Unbreakable
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ Unbreakable
ทำงานยังไง
สร้างออบเจ็กต์: Unbreakable. คืนค่า: new Unbreakable(bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
UseCooldown
- Full name:
net.minecraft.world.item.component.UseCooldown - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/UseCooldown.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.UseCooldown#apply(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/component/UseCooldown.java:35 - Modifiers:
public - Return:
void
คืออะไร
นำไปใช้ apply
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCooldowns(), addCooldown(), ticks().
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
UseCooldown instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
instance.apply(itemStack, livingEntity);
net.minecraft.world.item.component.UseCooldown#ticks()
- Origin:
common - Source:
net/minecraft/world/item/component/UseCooldown.java:31 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ ticks ตาม implementation ของ UseCooldown
ทำงานยังไง
คืนค่า: (int)(this.seconds * 20.0F).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.UseCooldown#UseCooldown(float)
- Origin:
common - Source:
net/minecraft/world/item/component/UseCooldown.java:27 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ UseCooldown ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: empty().
Parameters
float f
ตัวอย่างใช้งาน
UseRemainder
- Full name:
net.minecraft.world.item.component.UseRemainder - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/UseRemainder.java - Type:
record - Modifiers:
public
net.minecraft.world.item.component.UseRemainder#convertIntoRemainder(ItemStack,int,boolean,UseRemainder.OnExtraCreatedRemainder)
- Origin:
common - Source:
net/minecraft/world/item/component/UseRemainder.java:14 - Modifiers:
public - Return:
ItemStack
คืออะไร
แปลง Into Remainder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCount(), copy(), isEmpty(), apply(). มีจุด return อย่างน้อย 4 จุด.
Parameters
ItemStack itemStackint iboolean blUseRemainder.OnExtraCreatedRemainder onExtraCreatedRemainder
ตัวอย่างใช้งาน
UseRemainder instance = ...;
ItemStack itemStack = ...;
UseRemainder.OnExtraCreatedRemainder onExtraCreatedRemainder = ...;
ItemStack result = instance.convertIntoRemainder(itemStack, 0, true, onExtraCreatedRemainder);
net.minecraft.world.item.component.UseRemainder#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/component/UseRemainder.java:32 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getClass(), matches(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Object object
ตัวอย่างใช้งาน
net.minecraft.world.item.component.UseRemainder#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/component/UseRemainder.java:44 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ UseRemainder
ทำงานยังไง
เรียกต่อ: hashItemAndComponents(). คืนค่า: ItemStack.hashItemAndComponents(this.convertInto).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
UseRemainder$OnExtraCreatedRemainder
- Full name:
net.minecraft.world.item.component.UseRemainder$OnExtraCreatedRemainder - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/UseRemainder.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.component.UseRemainder$OnExtraCreatedRemainder#apply(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/component/UseRemainder.java:51 - Modifiers: ``
- Return:
void
คืออะไร
นำไปใช้ apply
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
UseRemainder.OnExtraCreatedRemainder instance = ...;
ItemStack itemStack = ...;
instance.apply(itemStack);
WritableBookContent
- Full name:
net.minecraft.world.item.component.WritableBookContent - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/WritableBookContent.java - Type:
record - Modifiers:
public - Implements:
BookContent<String, WritableBookContent>
net.minecraft.world.item.component.WritableBookContent#getPages(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/WritableBookContent.java:31 - Modifiers:
public - Return:
Stream<String>
คืออะไร
อ่านค่า Pages
ทำงานยังไง
เรียกต่อ: stream(), map(), get(). คืนค่า: this.pages.stream().map(filterable -> filterable.get(bl)).
Parameters
boolean bl
ตัวอย่างใช้งาน
net.minecraft.world.item.component.WritableBookContent#withReplacedPages(List<Filterable<String>>)
- Origin:
common - Source:
net/minecraft/world/item/component/WritableBookContent.java:35 - Modifiers:
public - Return:
WritableBookContent
คืออะไร
ดำเนินการ withReplacedPages ตาม implementation ของ WritableBookContent
ทำงานยังไง
สร้างออบเจ็กต์: WritableBookContent. คืนค่า: new WritableBookContent(list).
Parameters
List<Filterable<String>> list
ตัวอย่างใช้งาน
WritableBookContent instance = ...;
List<Filterable<String>> list = ...;
WritableBookContent result = instance.withReplacedPages(list);
net.minecraft.world.item.component.WritableBookContent#WritableBookContent(List<Filterable<String>>)
- Origin:
common - Source:
net/minecraft/world/item/component/WritableBookContent.java:25 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ WritableBookContent ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: size(). สร้างออบเจ็กต์: IllegalArgumentException.
Parameters
List<Filterable<String>> pages
ตัวอย่างใช้งาน
List<Filterable<String>> pages = ...;
WritableBookContent instance = new WritableBookContent(pages);
WrittenBookContent
- Full name:
net.minecraft.world.item.component.WrittenBookContent - Package:
net.minecraft.world.item.component - Source:
common—net/minecraft/world/item/component/WrittenBookContent.java - Type:
record - Modifiers:
public - Implements:
BookContent<Component, WrittenBookContent>
net.minecraft.world.item.component.WrittenBookContent#getPages(boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:121 - Modifiers:
public - Return:
List<Component>
คืออะไร
อ่านค่า Pages
ทำงานยังไง
เรียกต่อ: transform(), get(). คืนค่า: Lists.transform(this.pages, filterable -> filterable.get(bl)).
Parameters
boolean bl
ตัวอย่างใช้งาน
net.minecraft.world.item.component.WrittenBookContent#markResolved()
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:102 - Modifiers:
public - Return:
WrittenBookContent
คืออะไร
ดำเนินการ markResolved ตาม implementation ของ WrittenBookContent
ทำงานยังไง
สร้างออบเจ็กต์: WrittenBookContent. คืนค่า: new WrittenBookContent(this.title, this.author, this.generation, this.pages, true).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.WrittenBookContent#pagesCodec(Codec<Component>)
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:73 - Modifiers:
public static - Return:
Codec<List<Filterable<Component>>>
คืออะไร
ดำเนินการ pagesCodec ตาม implementation ของ WrittenBookContent
ทำงานยังไง
เรียกต่อ: pageCodec(), listOf(). คืนค่า: pageCodec(codec).listOf().
Parameters
Codec<Component> codec
ตัวอย่างใช้งาน
Codec<Component> codec = ...;
Codec<List<Filterable<Component>>> result = WrittenBookContent.pagesCodec(codec);
net.minecraft.world.item.component.WrittenBookContent#resolve(CommandSourceStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:82 - Modifiers:
public - Return:
WrittenBookContent
คืออะไร
ดำเนินการ resolve ตาม implementation ของ WrittenBookContent
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: builderWithExpectedSize(), size(), resolvePage(), isEmpty(), add(), get(), build(). สร้างออบเจ็กต์: WrittenBookContent. มีจุด return อย่างน้อย 3 จุด.
Parameters
CommandSourceStack commandSourceStackPlayer player
ตัวอย่างใช้งาน
WrittenBookContent instance = ...;
CommandSourceStack commandSourceStack = ...;
Player player = ...;
WrittenBookContent result = instance.resolve(commandSourceStack, player);
net.minecraft.world.item.component.WrittenBookContent#tryCraftCopy()
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:77 - Modifiers:
public - Return:
WrittenBookContent
คืออะไร
ดำเนินการ tryCraftCopy ตาม implementation ของ WrittenBookContent
ทำงานยังไง
สร้างออบเจ็กต์: WrittenBookContent. คืนค่า: this.generation >= 2 ? null : new WrittenBookContent(this.title, this.author, this.generation + 1, this.pages, this.resolved).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.component.WrittenBookContent#withReplacedPages(List<Filterable<Component>>)
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:125 - Modifiers:
public - Return:
WrittenBookContent
คืออะไร
ดำเนินการ withReplacedPages ตาม implementation ของ WrittenBookContent
ทำงานยังไง
สร้างออบเจ็กต์: WrittenBookContent. คืนค่า: new WrittenBookContent(this.title, this.author, this.generation, list, false).
Parameters
List<Filterable<Component>> list
ตัวอย่างใช้งาน
WrittenBookContent instance = ...;
List<Filterable<Component>> list = ...;
WrittenBookContent result = instance.withReplacedPages(list);
net.minecraft.world.item.component.WrittenBookContent#WrittenBookContent(Filterable<String>,String,int,List<Filterable<Component>>,boolean)
- Origin:
common - Source:
net/minecraft/world/item/component/WrittenBookContent.java:57 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ WrittenBookContent ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: title, author, generation, pages, resolved. สร้างออบเจ็กต์: IllegalArgumentException.
Parameters
Filterable<String> titleString authorint generationList<Filterable<Component>> pagesboolean resolved
ตัวอย่างใช้งาน
Filterable<String> title = ...;
List<Filterable<Component>> pages = ...;
WrittenBookContent instance = new WrittenBookContent(title, "value", 0, pages, true);