Package net.minecraft.world.item
Part 1/1
AdventureModePredicate
- Full name:
net.minecraft.world.item.AdventureModePredicate - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/AdventureModePredicate.java - Type:
class - Modifiers:
public
net.minecraft.world.item.AdventureModePredicate#addToTooltip(Consumer<Component>)
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:98 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
เรียกต่อ: tooltip(), forEach().
Parameters
Consumer<Component> consumer
ตัวอย่างใช้งาน
AdventureModePredicate instance = ...;
Consumer<Component> consumer = ...;
instance.addToTooltip(consumer);
net.minecraft.world.item.AdventureModePredicate#AdventureModePredicate(List<BlockPredicate>,boolean)
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:50 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ AdventureModePredicate ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: predicates, showInTooltip.
Parameters
List<BlockPredicate> listboolean bl
ตัวอย่างใช้งาน
List<BlockPredicate> list = ...;
AdventureModePredicate instance = new AdventureModePredicate(list, true);
net.minecraft.world.item.AdventureModePredicate#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:124 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: showInTooltip. คืนค่า: true.
Parameters
Object object
ตัวอย่างใช้งาน
AdventureModePredicate instance = ...;
Object object = ...;
boolean result = instance.equals(object);
net.minecraft.world.item.AdventureModePredicate#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:135 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ AdventureModePredicate
ทำงานยังไง
คืนค่า: this.predicates.hashCode() * 31 + (this.showInTooltip ? 1 : 0).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.AdventureModePredicate#showInTooltip()
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:120 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ showInTooltip ตาม implementation ของ AdventureModePredicate
ทำงานยังไง
คืนค่า: this.showInTooltip.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.AdventureModePredicate#test(BlockInWorld)
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:70 - Modifiers:
public - Return:
boolean
คืออะไร
ทดสอบเงื่อนไข test
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: lastCheckedBlock, checksBlockEntity, lastResult. เรียกต่อ: areSameBlocks(), matches(), requiresNbt(). มีจุด return อย่างน้อย 3 จุด.
Parameters
BlockInWorld blockInWorld
ตัวอย่างใช้งาน
AdventureModePredicate instance = ...;
BlockInWorld blockInWorld = ...;
boolean result = instance.test(blockInWorld);
net.minecraft.world.item.AdventureModePredicate#toString()
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:140 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ AdventureModePredicate
ทำงานยังไง
คืนค่า: "AdventureModePredicate{predicates=" + this.predicates + ", showInTooltip=" + this.showInTooltip + "}".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.AdventureModePredicate#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/AdventureModePredicate.java:102 - Modifiers:
public - Return:
AdventureModePredicate
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ AdventureModePredicate
ทำงานยังไง
สร้างออบเจ็กต์: AdventureModePredicate. คืนค่า: new AdventureModePredicate(this.predicates, bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
AirItem
- Full name:
net.minecraft.world.item.AirItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/AirItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.AirItem#AirItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/AirItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ AirItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: block.
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
AirItem instance = new AirItem(block, properties);
net.minecraft.world.item.AirItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/AirItem.java:15 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ AirItem
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 2 statement).
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
AirItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.AirItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/AirItem.java:21 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
คืนค่า: this.getName().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
AnimalArmorItem
- Full name:
net.minecraft.world.item.AnimalArmorItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/AnimalArmorItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.AnimalArmorItem#AnimalArmorItem(ArmorMaterial,AnimalArmorItem.BodyType,Holder<SoundEvent>,boolean,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/AnimalArmorItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ AnimalArmorItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: bodyType. เรียกต่อ: animalProperties().
Parameters
ArmorMaterial armorMaterialAnimalArmorItem.BodyType bodyTypeHolder<SoundEvent> holderboolean blItem.Properties properties
ตัวอย่างใช้งาน
ArmorMaterial armorMaterial = ...;
AnimalArmorItem.BodyType bodyType = ...;
Holder<SoundEvent> holder = ...;
Item.Properties properties = ...;
AnimalArmorItem instance = new AnimalArmorItem(armorMaterial, bodyType, holder, true, properties);
net.minecraft.world.item.AnimalArmorItem#AnimalArmorItem(ArmorMaterial,AnimalArmorItem.BodyType,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/AnimalArmorItem.java:13 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ AnimalArmorItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: bodyType. เรียกต่อ: animalProperties().
Parameters
ArmorMaterial armorMaterialAnimalArmorItem.BodyType bodyTypeItem.Properties properties
ตัวอย่างใช้งาน
ArmorMaterial armorMaterial = ...;
AnimalArmorItem.BodyType bodyType = ...;
Item.Properties properties = ...;
AnimalArmorItem instance = new AnimalArmorItem(armorMaterial, bodyType, properties);
net.minecraft.world.item.AnimalArmorItem#getBreakingSound()
- Origin:
common - Source:
net/minecraft/world/item/AnimalArmorItem.java:23 - Modifiers:
public - Return:
SoundEvent
คืออะไร
อ่านค่า Breaking Sound
ทำงานยังไง
คืนค่า: this.bodyType.breakingSound.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ArmorItem
- Full name:
net.minecraft.world.item.ArmorItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ArmorItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.ArmorItem#ArmorItem(ArmorMaterial,ArmorType,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ArmorItem.java:7 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ArmorItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: humanoidProperties().
Parameters
ArmorMaterial armorMaterialArmorType armorTypeItem.Properties properties
ตัวอย่างใช้งาน
ArmorMaterial armorMaterial = ...;
ArmorType armorType = ...;
Item.Properties properties = ...;
ArmorItem instance = new ArmorItem(armorMaterial, armorType, properties);
ArmorStandItem
- Full name:
net.minecraft.world.item.ArmorStandItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ArmorStandItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.ArmorStandItem#ArmorStandItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ArmorStandItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ArmorStandItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.ArmorStandItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/ArmorStandItem.java:26 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getClickedFace(), getLevel(), getClickedPos(), getItemInHand(), atBottomCenterOf(), getDimensions(), makeBoundingBox(), x(). สร้างออบเจ็กต์: BlockPlaceContext. มีจุด return อย่างน้อย 4 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
ArmorStandItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
ArrowItem
- Full name:
net.minecraft.world.item.ArrowItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ArrowItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.ArrowItem#ArrowItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ArrowItem.java:13 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ArrowItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.ArrowItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/ArrowItem.java:21 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ ArrowItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(), copyWithCount(). สร้างออบเจ็กต์: Arrow. คืนค่า: arrow.
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
ArrowItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.ArrowItem#createArrow(Level,ItemStack,LivingEntity,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ArrowItem.java:17 - Modifiers:
public - Return:
AbstractArrow
คืออะไร
สร้าง Arrow
ทำงานยังไง
เรียกต่อ: copyWithCount(). สร้างออบเจ็กต์: Arrow. คืนค่า: new Arrow(level, livingEntity, itemStack.copyWithCount(1), itemStack2).
Parameters
Level levelItemStack itemStackLivingEntity livingEntityItemStack itemStack2
ตัวอย่างใช้งาน
ArrowItem instance = ...;
Level level = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack2 = ...;
AbstractArrow result = instance.createArrow(level, itemStack, livingEntity, itemStack2);
AxeItem
- Full name:
net.minecraft.world.item.AxeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/AxeItem.java - Type:
class - Modifiers:
public - Extends:
DiggerItem
net.minecraft.world.item.AxeItem#AxeItem(ToolMaterial,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/AxeItem.java:53 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ AxeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ToolMaterial toolMaterialfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
Item.Properties properties = ...;
AxeItem instance = new AxeItem(toolMaterial, 0.0F, 0.0F, properties);
net.minecraft.world.item.AxeItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/AxeItem.java:57 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getPlayer(), playerHasShieldUseIntent(), evaluateNewBlockState(), getBlockState(), isEmpty(), getItemInHand(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
AxeItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
BannerItem
- Full name:
net.minecraft.world.item.BannerItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BannerItem.java - Type:
class - Modifiers:
public - Extends:
StandingAndWallBlockItem
net.minecraft.world.item.BannerItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/BannerItem.java:34 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ BannerItem
ทำงานยังไง
เรียกต่อ: appendHoverTextFromBannerBlockEntityTag().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
BannerItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.BannerItem#appendHoverTextFromBannerBlockEntityTag(ItemStack,List<Component>)
- Origin:
common - Source:
net/minecraft/world/item/BannerItem.java:20 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ appendHoverTextFromBannerBlockEntityTag ตาม implementation ของ BannerItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: get(), min(), layers(), size(), add(), description(), withStyle().
Parameters
ItemStack itemStackList<Component> list
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
List<Component> list = ...;
BannerItem.appendHoverTextFromBannerBlockEntityTag(itemStack, list);
net.minecraft.world.item.BannerItem#BannerItem(Block,Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BannerItem.java:14 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BannerItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: isInstanceOf().
Parameters
Block blockBlock block2Item.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Block block2 = ...;
Item.Properties properties = ...;
BannerItem instance = new BannerItem(block, block2, properties);
net.minecraft.world.item.BannerItem#getColor()
- Origin:
common - Source:
net/minecraft/world/item/BannerItem.java:30 - Modifiers:
public - Return:
DyeColor
คืออะไร
อ่านค่า Color
ทำงานยังไง
เรียกต่อ: getBlock(). คืนค่า: ((AbstractBannerBlock)this.getBlock()).getColor().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
BannerPatternItem
- Full name:
net.minecraft.world.item.BannerPatternItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BannerPatternItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BannerPatternItem#BannerPatternItem(TagKey<BannerPattern>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BannerPatternItem.java:9 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BannerPatternItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: bannerPattern.
Parameters
TagKey<BannerPattern> tagKeyItem.Properties properties
ตัวอย่างใช้งาน
TagKey<BannerPattern> tagKey = ...;
Item.Properties properties = ...;
BannerPatternItem instance = new BannerPatternItem(tagKey, properties);
net.minecraft.world.item.BannerPatternItem#getBannerPattern()
- Origin:
common - Source:
net/minecraft/world/item/BannerPatternItem.java:14 - Modifiers:
public - Return:
TagKey<BannerPattern>
คืออะไร
อ่านค่า Banner Pattern
ทำงานยังไง
คืนค่า: this.bannerPattern.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
BedItem
- Full name:
net.minecraft.world.item.BedItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BedItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.BedItem#BedItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BedItem.java:8 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BedItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
BedItem instance = new BedItem(block, properties);
net.minecraft.world.item.BedItem#placeBlock(BlockPlaceContext,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/BedItem.java:12 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ placeBlock ตาม implementation ของ BedItem
ทำงานยังไง
เรียกต่อ: getLevel(), setBlock(), getClickedPos(). คืนค่า: blockPlaceContext.getLevel().setBlock(blockPlaceContext.getClickedPos(), blockState, 26).
Parameters
BlockPlaceContext blockPlaceContextBlockState blockState
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
BlockState blockState = ...;
@Override
protected boolean placeBlock(BlockPlaceContext blockPlaceContext, BlockState blockState) {
return super.placeBlock(blockPlaceContext, blockState);
}
BlockItem
- Full name:
net.minecraft.world.item.BlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BlockItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BlockItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:182 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ BlockItem
ทำงานยังไง
เรียกต่อ: getBlock().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
BlockItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.BlockItem#BlockItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:38 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: block.
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
BlockItem instance = new BlockItem(block, properties);
net.minecraft.world.item.BlockItem#canFitInsideContainerItems()
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:209 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Fit Inside Container Items
ทำงานยังไง
เรียกต่อ: getBlock(). คืนค่า: !(this.getBlock() instanceof ShulkerBoxBlock).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BlockItem#canPlace(BlockPlaceContext,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:137 - Modifiers:
protected - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Place
ทำงานยังไง
เรียกต่อ: getPlayer(), empty(), of(), mustSurvive(), canSurvive(), getLevel(), getClickedPos(), isUnobstructed().
Parameters
BlockPlaceContext blockPlaceContextBlockState blockState
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
BlockState blockState = ...;
@Override
protected boolean canPlace(BlockPlaceContext blockPlaceContext, BlockState blockState) {
return super.canPlace(blockPlaceContext, blockState);
}
net.minecraft.world.item.BlockItem#getBlock()
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:201 - Modifiers:
public - Return:
Block
คืออะไร
อ่านค่า Block
ทำงานยังไง
คืนค่า: this.block.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BlockItem#getPlacementState(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:117 - Modifiers:
protected - Return:
BlockState
คืออะไร
อ่านค่า Placement State
ทำงานยังไง
เรียกต่อ: getBlock(), getStateForPlacement(), canPlace(). คืนค่า: blockState != null && this.canPlace(blockPlaceContext, blockState) ? blockState : null.
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
@Override
protected BlockState getPlacementState(BlockPlaceContext blockPlaceContext) {
return super.getPlacementState(blockPlaceContext);
}
net.minecraft.world.item.BlockItem#getPlaceSound(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:96 - Modifiers:
protected - Return:
SoundEvent
คืออะไร
อ่านค่า Place Sound
ทำงานยังไง
เรียกต่อ: getSoundType(). คืนค่า: blockState.getSoundType().getPlaceSound().
Parameters
BlockState blockState
ตัวอย่างใช้งาน
BlockState blockState = ...;
@Override
protected SoundEvent getPlaceSound(BlockState blockState) {
return super.getPlaceSound(blockState);
}
net.minecraft.world.item.BlockItem#mustSurvive()
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:144 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ mustSurvive ตาม implementation ของ BlockItem
ทำงานยังไง
คืนค่า: true.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BlockItem#onDestroyed(ItemEntity)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:214 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Destroyed
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), set(), onContainerDestroyed(), nonEmptyItemsCopy().
Parameters
ItemEntity itemEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.BlockItem#place(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:51 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ดำเนินการ place ตาม implementation ของ BlockItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlock(), isEnabled(), getLevel(), enabledFeatures(), canPlace(), updatePlacementContext(), getPlacementState(), placeBlock(). มีจุด return อย่างน้อย 6 จุด.
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
BlockItem instance = ...;
BlockPlaceContext blockPlaceContext = ...;
InteractionResult result = instance.place(blockPlaceContext);
net.minecraft.world.item.BlockItem#placeBlock(BlockPlaceContext,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:148 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ placeBlock ตาม implementation ของ BlockItem
ทำงานยังไง
เรียกต่อ: getLevel(), setBlock(), getClickedPos(). คืนค่า: blockPlaceContext.getLevel().setBlock(blockPlaceContext.getClickedPos(), blockState, 11).
Parameters
BlockPlaceContext blockPlaceContextBlockState blockState
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
BlockState blockState = ...;
@Override
protected boolean placeBlock(BlockPlaceContext blockPlaceContext, BlockState blockState) {
return super.placeBlock(blockPlaceContext, blockState);
}
net.minecraft.world.item.BlockItem#registerBlocks(Map<Block, Item>,Item)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:205 - Modifiers:
public - Return:
void
คืออะไร
ลงทะเบียน Blocks
ทำงานยังไง
เรียกต่อ: put(), getBlock().
Parameters
Map<Block, Item> mapItem item
ตัวอย่างใช้งาน
BlockItem instance = ...;
Map<Block, Item> map = ...;
Item item = ...;
instance.registerBlocks(map, item);
net.minecraft.world.item.BlockItem#requiredFeatures()
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:232 - Modifiers:
public - Return:
FeatureFlagSet
คืออะไร
ดำเนินการ requiredFeatures ตาม implementation ของ BlockItem
ทำงานยังไง
เรียกต่อ: getBlock(). คืนค่า: this.getBlock().requiredFeatures().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BlockItem#setBlockEntityData(ItemStack,BlockEntityType<?>,CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:222 - Modifiers:
public static - Return:
void
คืออะไร
กำหนดค่า Block Entity Data
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: remove(), isEmpty(), addEntityType(), set(), of().
Parameters
ItemStack itemStackBlockEntityType<?> blockEntityTypeCompoundTag compoundTag
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
BlockEntityType<?> blockEntityType = ...;
CompoundTag compoundTag = ...;
BlockItem.setBlockEntityData(itemStack, blockEntityType, compoundTag);
net.minecraft.world.item.BlockItem#shouldPrintOpWarning(ItemStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:188 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าควร Print Op Warning
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPermissionLevel(), get(), parseEntityType(), level(), registryAccess(), onlyOpCanSetNbt(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackPlayer player
ตัวอย่างใช้งาน
BlockItem instance = ...;
ItemStack itemStack = ...;
Player player = ...;
boolean result = instance.shouldPrintOpWarning(itemStack, player);
net.minecraft.world.item.BlockItem#updateCustomBlockEntityTag(BlockPos,Level,Player,ItemStack,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:113 - Modifiers:
protected - Return:
boolean
คืออะไร
อัปเดต Custom Block Entity Tag
ทำงานยังไง
คืนค่า: updateCustomBlockEntityTag(level, player, blockPos, itemStack).
Parameters
BlockPos blockPosLevel levelPlayer playerItemStack itemStackBlockState blockState
ตัวอย่างใช้งาน
BlockPos blockPos = ...;
Level level = ...;
Player player = ...;
ItemStack itemStack = ...;
BlockState blockState = ...;
@Override
protected boolean updateCustomBlockEntityTag(BlockPos blockPos, Level level, Player player, ItemStack itemStack, BlockState blockState) {
return super.updateCustomBlockEntityTag(blockPos, level, player, itemStack, blockState);
}
net.minecraft.world.item.BlockItem#updateCustomBlockEntityTag(Level,Player,BlockPos,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:152 - Modifiers:
public static - Return:
boolean
คืออะไร
อัปเดต Custom Block Entity Tag
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getOrDefault(), isEmpty(), parseEntityType(), registryAccess(), getBlockEntity(), getType(), onlyOpCanSetNbt(), canUseGameMasterBlocks(). มีจุด return อย่างน้อย 6 จุด.
Parameters
Level levelPlayer playerBlockPos blockPosItemStack itemStack
ตัวอย่างใช้งาน
Level level = ...;
Player player = ...;
BlockPos blockPos = ...;
ItemStack itemStack = ...;
boolean result = BlockItem.updateCustomBlockEntityTag(level, player, blockPos, itemStack);
net.minecraft.world.item.BlockItem#updatePlacementContext(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:100 - Modifiers:
public - Return:
BlockPlaceContext
คืออะไร
อัปเดต Placement Context
ทำงานยังไง
คืนค่า: blockPlaceContext.
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
BlockItem instance = ...;
BlockPlaceContext blockPlaceContext = ...;
BlockPlaceContext result = instance.updatePlacementContext(blockPlaceContext);
net.minecraft.world.item.BlockItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/BlockItem.java:43 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
เรียกต่อ: place(), consumesAction(), getItemInHand(), has(), use(), getLevel(), getPlayer(), getHand(). สร้างออบเจ็กต์: BlockPlaceContext.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
BlockItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
BoatItem
- Full name:
net.minecraft.world.item.BoatItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BoatItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BoatItem#BoatItem(EntityType<? extends AbstractBoat>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BoatItem.java:25 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BoatItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: entityType.
Parameters
EntityType<? extends AbstractBoat> entityTypeItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends AbstractBoat> entityType = ...;
Item.Properties properties = ...;
BoatItem instance = new BoatItem(entityType, properties);
net.minecraft.world.item.BoatItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/BoatItem.java:30 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getItemInHand(), getPlayerPOVHitResult(), getType(), getViewVector(), getEntities(), getBoundingBox(), expandTowards(), scale(). มีจุด return อย่างน้อย 6 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
BoatItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
BoneMealItem
- Full name:
net.minecraft.world.item.BoneMealItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BoneMealItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BoneMealItem#addGrowthParticles(LevelAccessor,BlockPos,int)
- Origin:
common - Source:
net/minecraft/world/item/BoneMealItem.java:143 - Modifiers:
public static - Return:
void
คืออะไร
เพิ่ม Growth Particles
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: getBlockState(), getBlock(), getParticlePos(), getType(), spawnParticles(), spawnParticleInBlock(), is().
Parameters
LevelAccessor levelAccessorBlockPos blockPosint i
ตัวอย่างใช้งาน
LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
BoneMealItem.addGrowthParticles(levelAccessor, blockPos, 0);
net.minecraft.world.item.BoneMealItem#BoneMealItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BoneMealItem.java:31 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BoneMealItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.BoneMealItem#growCrop(ItemStack,Level,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/BoneMealItem.java:63 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ growCrop ตาม implementation ของ BoneMealItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlockState(), getBlock(), isValidBonemealTarget(), isBonemealSuccess(), performBonemeal(), shrink(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackLevel levelBlockPos blockPos
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Level level = ...;
BlockPos blockPos = ...;
boolean result = BoneMealItem.growCrop(itemStack, level, blockPos);
net.minecraft.world.item.BoneMealItem#growWaterPlant(ItemStack,Level,BlockPos,Direction)
- Origin:
common - Source:
net/minecraft/world/item/BoneMealItem.java:80 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ growWaterPlant ตาม implementation ของ BoneMealItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBlockState(), is(), getFluidState(), getAmount(), getRandom(), defaultBlockState(), offset(), nextInt(). มีจุด return อย่างน้อย 3 จุด.
Parameters
ItemStack itemStackLevel levelBlockPos blockPosDirection direction
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Level level = ...;
BlockPos blockPos = ...;
Direction direction = ...;
boolean result = BoneMealItem.growWaterPlant(itemStack, level, blockPos, direction);
net.minecraft.world.item.BoneMealItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/BoneMealItem.java:35 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), relative(), getClickedFace(), growCrop(), getItemInHand(), getPlayer(), gameEvent(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
BoneMealItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
BottleItem
- Full name:
net.minecraft.world.item.BottleItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BottleItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BottleItem#BottleItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BottleItem.java:25 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BottleItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.BottleItem#turnBottleIntoItem(ItemStack,Player,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BottleItem.java:71 - Modifiers:
protected - Return:
ItemStack
คืออะไร
ดำเนินการ turnBottleIntoItem ตาม implementation ของ BottleItem
ทำงานยังไง
เรียกต่อ: awardStat(), get(), createFilledResult(). คืนค่า: ItemUtils.createFilledResult(itemStack, player, itemStack2).
Parameters
ItemStack itemStackPlayer playerItemStack itemStack2
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Player player = ...;
ItemStack itemStack2 = ...;
@Override
protected ItemStack turnBottleIntoItem(ItemStack itemStack, Player player, ItemStack itemStack2) {
return super.turnBottleIntoItem(itemStack, player, itemStack2);
}
net.minecraft.world.item.BottleItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/BottleItem.java:29 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getEntitiesOfClass(), getBoundingBox(), inflate(), isAlive(), getOwner(), getItemInHand(), isEmpty(), get(). สร้างออบเจ็กต์: ItemStack. มีจุด return อย่างน้อย 5 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
BottleItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
BowItem
- Full name:
net.minecraft.world.item.BowItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BowItem.java - Type:
class - Modifiers:
public - Extends:
ProjectileWeaponItem
net.minecraft.world.item.BowItem#BowItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:21 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BowItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.BowItem#getAllSupportedProjectiles()
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:98 - Modifiers:
public - Return:
Predicate<ItemStack>
คืออะไร
อ่านค่า All Supported Projectiles
ทำงานยังไง
คืนค่า: ARROW_ONLY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BowItem#getDefaultProjectileRange()
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:103 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Default Projectile Range
ทำงานยังไง
คืนค่า: 15.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BowItem#getPowerForTime(int)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:66 - Modifiers:
public static - Return:
float
คืออะไร
อ่านค่า Power For Time
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. คืนค่า: f.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.BowItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:81 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.BOW.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BowItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.BowItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:76 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 72000.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
BowItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.BowItem#releaseUsing(ItemStack,Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:25 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ BowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getProjectile(), isEmpty(), getUseDuration(), getPowerForTime(), draw(), shoot(), getUsedItemHand(), playSound(). มีจุด return อย่างน้อย 4 จุด.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
BowItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
boolean result = instance.releaseUsing(itemStack, level, livingEntity, 0);
net.minecraft.world.item.BowItem#shootProjectile(LivingEntity,Projectile,int,float,float,float,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:61 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ shootProjectile ตาม implementation ของ BowItem
ทำงานยังไง
เรียกต่อ: shootFromRotation(), getXRot(), getYRot().
Parameters
LivingEntity livingEntityProjectile projectileint ifloat ffloat gfloat hLivingEntity livingEntity2
ตัวอย่างใช้งาน
LivingEntity livingEntity = ...;
Projectile projectile = ...;
LivingEntity livingEntity2 = ...;
@Override
protected void shootProjectile(LivingEntity livingEntity, Projectile projectile, int i, float f, float g, float h, LivingEntity livingEntity2) {
super.shootProjectile(livingEntity, projectile, i, f, g, h, livingEntity2);
}
net.minecraft.world.item.BowItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/BowItem.java:86 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), getProjectile(), isEmpty(), hasInfiniteMaterials(), startUsingItem(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
BowItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
BrushItem
- Full name:
net.minecraft.world.item.BrushItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BrushItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BrushItem#BrushItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BrushItem.java:33 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BrushItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.BrushItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BrushItem.java:47 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.BRUSH.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BrushItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.BrushItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/BrushItem.java:52 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 200.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
BrushItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.BrushItem#onUseTick(Level,LivingEntity,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/BrushItem.java:57 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Use Tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: calculateHitResult(), getType(), getUseDuration(), getBlockPos(), getBlockState(), getUsedItemHand(), getMainArm(), getOpposite().
Parameters
Level levelLivingEntity livingEntityItemStack itemStackint i
ตัวอย่างใช้งาน
BrushItem instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
instance.onUseTick(level, livingEntity, itemStack, 0);
net.minecraft.world.item.BrushItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/BrushItem.java:37 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPlayer(), calculateHitResult(), getType(), startUsingItem(), getHand(). คืนค่า: InteractionResult.CONSUME.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
BrushItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
BucketItem
- Full name:
net.minecraft.world.item.BucketItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BucketItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
DispensibleContainerItem
net.minecraft.world.item.BucketItem#BucketItem(Fluid,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:34 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BucketItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: content.
Parameters
Fluid fluidItem.Properties properties
ตัวอย่างใช้งาน
Fluid fluid = ...;
Item.Properties properties = ...;
BucketItem instance = new BucketItem(fluid, properties);
net.minecraft.world.item.BucketItem#checkExtraContent(Player,Level,ItemStack,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:98 - Modifiers:
public - Return:
void
คืออะไร
ตรวจสอบ Extra Content
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Player playerLevel levelItemStack itemStackBlockPos blockPos
ตัวอย่างใช้งาน
BucketItem instance = ...;
Player player = ...;
Level level = ...;
ItemStack itemStack = ...;
BlockPos blockPos = ...;
instance.checkExtraContent(player, level, itemStack, blockPos);
net.minecraft.world.item.BucketItem#emptyContents(Player,Level,BlockPos,BlockHitResult)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:102 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ emptyContents ตาม implementation ของ BucketItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: content. เรียกต่อ: getBlockState(), getBlock(), canBeReplaced(), isAir(), canPlaceLiquid(), getBlockPos(), relative(), getDirection(). มีจุด return อย่างน้อย 6 จุด.
Parameters
Player playerLevel levelBlockPos blockPosBlockHitResult blockHitResult
ตัวอย่างใช้งาน
BucketItem instance = ...;
Player player = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockHitResult blockHitResult = ...;
boolean result = instance.emptyContents(player, level, blockPos, blockHitResult);
net.minecraft.world.item.BucketItem#getEmptySuccessItem(ItemStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:94 - Modifiers:
public static - Return:
ItemStack
คืออะไร
อ่านค่า Empty Success Item
ทำงานยังไง
เรียกต่อ: hasInfiniteMaterials(). สร้างออบเจ็กต์: ItemStack. คืนค่า: !player.hasInfiniteMaterials() ? new ItemStack(Items.BUCKET) : itemStack.
Parameters
ItemStack itemStackPlayer player
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Player player = ...;
ItemStack result = BucketItem.getEmptySuccessItem(itemStack, player);
net.minecraft.world.item.BucketItem#playEmptySound(Player,LevelAccessor,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:149 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ playEmptySound ตาม implementation ของ BucketItem
ทำงานยังไง
เรียกต่อ: is(), playSound(), gameEvent().
Parameters
Player playerLevelAccessor levelAccessorBlockPos blockPos
ตัวอย่างใช้งาน
Player player = ...;
LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
@Override
protected void playEmptySound(Player player, LevelAccessor levelAccessor, BlockPos blockPos) {
super.playEmptySound(player, levelAccessor, blockPos);
}
net.minecraft.world.item.BucketItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/BucketItem.java:39 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: content. เรียกต่อ: getItemInHand(), getPlayerPOVHitResult(), getType(), getBlockPos(), getDirection(), relative(), mayInteract(), mayUseItemAt(). มีจุด return อย่างน้อย 7 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
BucketItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
BundleItem
- Full name:
net.minecraft.world.item.BundleItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/BundleItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.BundleItem#BundleItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:39 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ BundleItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getAllBundleItemColors()
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:251 - Modifiers:
public static - Return:
List<BundleItem>
คืออะไร
อ่านค่า All Bundle Item Colors
ทำงานยังไง
เรียกต่อ: of(), map(), toList().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getBarColor(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:152 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Color
ทำงานยังไง
เรียกต่อ: getOrDefault(), weight(), compareTo(). คืนค่า: bundleContents.weight().compareTo(Fraction.ONE) >= 0 ? FULL_BAR_COLOR : BAR_COLOR.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getBarWidth(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:146 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Width
ทำงานยังไง
เรียกต่อ: getOrDefault(), min(), mulAndTruncate(), weight(). คืนค่า: Math.min(1 + Mth.mulAndTruncate(bundleContents.weight(), 12), 13).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getByColor(DyeColor)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:275 - Modifiers:
public static - Return:
Item
คืออะไร
อ่านค่า By Color
ทำงานยังไง
แยกกรณีด้วย switch. คืนค่า: switch (dyeColor) { case WHITE -> Items.WHITE_BUNDLE.
Parameters
DyeColor dyeColor
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getFullnessDisplay(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:43 - Modifiers:
public static - Return:
float
คืออะไร
อ่านค่า Fullness Display
ทำงานยังไง
เรียกต่อ: getOrDefault(), weight(), floatValue(). คืนค่า: bundleContents.weight().floatValue().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getNumberOfItemsToShow(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:182 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Number Of Items To Show
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: bundleContents.getNumberOfItemsToShow().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getSelectedItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:172 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Selected Item
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: bundleContents.getSelectedItem().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getSelectedItemStack(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:177 - Modifiers:
public static - Return:
ItemStack
คืออะไร
อ่านค่า Selected Item Stack
ทำงานยังไง
เรียกต่อ: get(), getSelectedItem(), getItemUnsafe(). คืนค่า: bundleContents != null && bundleContents.getSelectedItem() != -1 ? bundleContents.getItemUnsafe(bundleContents.getSelectedItem()) : ItemStack.EMPTY.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#getTooltipImage(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:235 - Modifiers:
public - Return:
Optional<TooltipComponent>
คืออะไร
อ่านค่า Tooltip Image
ทำงานยังไง
เรียกต่อ: has(), ofNullable(), get(), map(), empty().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
Optional<TooltipComponent> result = instance.getTooltipImage(itemStack);
net.minecraft.world.item.BundleItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:230 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.BUNDLE.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.BundleItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:225 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 200.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.BundleItem#hasSelectedItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:167 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Selected Item
ทำงานยังไง
เรียกต่อ: get(), getSelectedItem(). คืนค่า: bundleContents != null && bundleContents.getSelectedItem() != -1.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#isBarVisible(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:140 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Bar Visible
ทำงานยังไง
เรียกต่อ: getOrDefault(), weight(), compareTo(). คืนค่า: bundleContents.weight().compareTo(Fraction.ZERO) > 0.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isBarVisible(itemStack);
net.minecraft.world.item.BundleItem#onDestroyed(ItemEntity)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:242 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Destroyed
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), get(), set(), onContainerDestroyed(), itemsCopy().
Parameters
ItemEntity itemEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#onUseTick(Level,LivingEntity,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:214 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Use Tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getUseDuration(), dropContent().
Parameters
Level levelLivingEntity livingEntityItemStack itemStackint i
ตัวอย่างใช้งาน
BundleItem instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
instance.onUseTick(level, livingEntity, itemStack, 0);
net.minecraft.world.item.BundleItem#overrideOtherStackedOnMe(ItemStack,ItemStack,Slot,ClickAction,Player,SlotAccess)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:86 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideOtherStackedOnMe ตาม implementation ของ BundleItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), toggleSelectedItem(), get(), Mutable(), allowModification(), tryInsert(), playInsertSound(), playInsertFailSound(). สร้างออบเจ็กต์: BundleContents.Mutable. มีจุด return อย่างน้อย 5 จุด.
Parameters
ItemStack itemStackItemStack itemStack2Slot slotClickAction clickActionPlayer playerSlotAccess slotAccess
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
SlotAccess slotAccess = ...;
boolean result = instance.overrideOtherStackedOnMe(itemStack, itemStack2, slot, clickAction, player, slotAccess);
net.minecraft.world.item.BundleItem#overrideStackedOnOther(ItemStack,Slot,ClickAction,Player)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:48 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideStackedOnOther ตาม implementation ของ BundleItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), getItem(), Mutable(), isEmpty(), tryTransfer(), playInsertSound(), playInsertFailSound(), set(). สร้างออบเจ็กต์: BundleContents.Mutable. มีจุด return อย่างน้อย 4 จุด.
Parameters
ItemStack itemStackSlot slotClickAction clickActionPlayer player
ตัวอย่างใช้งาน
BundleItem instance = ...;
ItemStack itemStack = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
boolean result = instance.overrideStackedOnOther(itemStack, slot, clickAction, player);
net.minecraft.world.item.BundleItem#toggleSelectedItem(ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:158 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ toggleSelectedItem ตาม implementation ของ BundleItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), Mutable(), set(), toImmutable(). สร้างออบเจ็กต์: BundleContents.Mutable.
Parameters
ItemStack itemStackint i
ตัวอย่างใช้งาน
net.minecraft.world.item.BundleItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/BundleItem.java:127 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: startUsingItem(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
BundleItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
CompassItem
- Full name:
net.minecraft.world.item.CompassItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CompassItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.CompassItem#CompassItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/CompassItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ CompassItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.CompassItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CompassItem.java:71 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: has(). คืนค่า: itemStack.has(DataComponents.LODESTONE_TRACKER) ? LODESTONE_COMPASS_NAME : super.getName(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
CompassItem instance = ...;
ItemStack itemStack = ...;
Component result = instance.getName(itemStack);
net.minecraft.world.item.CompassItem#inventoryTick(ItemStack,Level,Entity,int,boolean)
- Origin:
common - Source:
net/minecraft/world/item/CompassItem.java:31 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ inventoryTick ตาม implementation ของ CompassItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), tick(), set().
Parameters
ItemStack itemStackLevel levelEntity entityint iboolean bl
ตัวอย่างใช้งาน
CompassItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
Entity entity = ...;
instance.inventoryTick(itemStack, level, entity, 0, true);
net.minecraft.world.item.CompassItem#isFoil(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CompassItem.java:26 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Foil
ทำงานยังไง
เรียกต่อ: has(). คืนค่า: itemStack.has(DataComponents.LODESTONE_TRACKER) || super.isFoil(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.CompassItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/CompassItem.java:44 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getClickedPos(), getLevel(), getBlockState(), is(), playSound(), getPlayer(), getItemInHand(), hasInfiniteMaterials(). สร้างออบเจ็กต์: LodestoneTracker. มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
CompassItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
CreativeModeTab
- Full name:
net.minecraft.world.item.CreativeModeTab - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTab.java - Type:
class - Modifiers:
public
net.minecraft.world.item.CreativeModeTab#buildContents(CreativeModeTab.ItemDisplayParameters)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:104 - Modifiers:
public - Return:
void
คืออะไร
สร้าง Contents
ทำงานยังไง
แก้ state: displayItems, displayItemsSearchTab. เรียกต่อ: ItemDisplayBuilder(), getResourceKey(), orElseThrow(), accept(). สร้างออบเจ็กต์: CreativeModeTab.ItemDisplayBuilder, IllegalStateException.
Parameters
CreativeModeTab.ItemDisplayParameters itemDisplayParameters
ตัวอย่างใช้งาน
CreativeModeTab instance = ...;
CreativeModeTab.ItemDisplayParameters itemDisplayParameters = ...;
instance.buildContents(itemDisplayParameters);
net.minecraft.world.item.CreativeModeTab#builder(CreativeModeTab.Row,int)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:52 - Modifiers:
public static - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ builder ตาม implementation ของ CreativeModeTab
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: CreativeModeTab.Builder. คืนค่า: new CreativeModeTab.Builder(row, i).
Parameters
CreativeModeTab.Row rowint i
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#canScroll()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:76 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Scroll
ทำงานยังไง
คืนค่า: this.canScroll.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#column()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:80 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ column ตาม implementation ของ CreativeModeTab
ทำงานยังไง
คืนค่า: this.column.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#contains(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:122 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี contains
ทำงานยังไง
คืนค่า: this.displayItemsSearchTab.contains(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
CreativeModeTab instance = ...;
ItemStack itemStack = ...;
boolean result = instance.contains(itemStack);
net.minecraft.world.item.CreativeModeTab#createTextureLocation(String)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:48 - Modifiers:
public static - Return:
ResourceLocation
คืออะไร
สร้าง Texture Location
ทำงานยังไง
เรียกต่อ: withDefaultNamespace(). คืนค่า: ResourceLocation.withDefaultNamespace("textures/gui/container/creative_inventory/tab_" + string + ".png").
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getBackgroundTexture()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:68 - Modifiers:
public - Return:
ResourceLocation
คืออะไร
อ่านค่า Background Texture
ทำงานยังไง
คืนค่า: this.backgroundTexture.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getDisplayItems()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:114 - Modifiers:
public - Return:
Collection<ItemStack>
คืออะไร
อ่านค่า Display Items
ทำงานยังไง
คืนค่า: this.displayItems.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getDisplayName()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:56 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Display Name
ทำงานยังไง
คืนค่า: this.displayName.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getIconItem()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:60 - Modifiers:
public - Return:
ItemStack
คืออะไร
อ่านค่า Icon Item
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: iconItemStack. เรียกต่อ: get(). คืนค่า: this.iconItemStack.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getSearchTabDisplayItems()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:118 - Modifiers:
public - Return:
Collection<ItemStack>
คืออะไร
อ่านค่า Search Tab Display Items
ทำงานยังไง
คืนค่า: this.displayItemsSearchTab.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#getType()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:100 - Modifiers:
public - Return:
CreativeModeTab.Type
คืออะไร
อ่านค่า Type
ทำงานยังไง
คืนค่า: this.type.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#hasAnyItems()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:88 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Any Items
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: !this.displayItems.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#isAlignedRight()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:96 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Aligned Right
ทำงานยังไง
คืนค่า: this.alignedRight.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#row()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:84 - Modifiers:
public - Return:
CreativeModeTab.Row
คืออะไร
ดำเนินการ row ตาม implementation ของ CreativeModeTab
ทำงานยังไง
คืนค่า: this.row.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#shouldDisplay()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:92 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าควร Display
ทำงานยังไง
เรียกต่อ: hasAnyItems(). คืนค่า: this.type != CreativeModeTab.Type.CATEGORY || this.hasAnyItems().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab#showTitle()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:72 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ showTitle ตาม implementation ของ CreativeModeTab
ทำงานยังไง
คืนค่า: this.showTitle.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
CreativeModeTab$Builder
- Full name:
net.minecraft.world.item.CreativeModeTab$Builder - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTab.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.CreativeModeTab$Builder#alignedRight()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:159 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ alignedRight ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: alignedRight. คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Builder#backgroundTexture(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:179 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ backgroundTexture ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: backgroundTexture. คืนค่า: this.
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
CreativeModeTab.Builder instance = ...;
ResourceLocation resourceLocation = ...;
CreativeModeTab.Builder result = instance.backgroundTexture(resourceLocation);
net.minecraft.world.item.CreativeModeTab$Builder#build()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:184 - Modifiers:
public - Return:
CreativeModeTab
คืออะไร
สร้าง build
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: type. สร้างออบเจ็กต์: IllegalStateException, CreativeModeTab. คืนค่า: creativeModeTab.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Builder#Builder(CreativeModeTab.Row,int)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:139 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ CreativeModeTab.Builder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: row, column.
Parameters
CreativeModeTab.Row rowint i
ตัวอย่างใช้งาน
CreativeModeTab.Row row = ...;
CreativeModeTab.Builder instance = new CreativeModeTab.Builder(row, 0);
net.minecraft.world.item.CreativeModeTab$Builder#displayItems(CreativeModeTab.DisplayItemsGenerator)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:154 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ displayItems ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: displayItemsGenerator. คืนค่า: this.
Parameters
CreativeModeTab.DisplayItemsGenerator displayItemsGenerator
ตัวอย่างใช้งาน
CreativeModeTab.Builder instance = ...;
CreativeModeTab.DisplayItemsGenerator displayItemsGenerator = ...;
CreativeModeTab.Builder result = instance.displayItems(displayItemsGenerator);
net.minecraft.world.item.CreativeModeTab$Builder#hideTitle()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:164 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ hideTitle ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: showTitle. คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Builder#icon(Supplier<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:149 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ icon ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: iconGenerator. คืนค่า: this.
Parameters
Supplier<ItemStack> supplier
ตัวอย่างใช้งาน
CreativeModeTab.Builder instance = ...;
Supplier<ItemStack> supplier = ...;
CreativeModeTab.Builder result = instance.icon(supplier);
net.minecraft.world.item.CreativeModeTab$Builder#noScrollBar()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:169 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ noScrollBar ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: canScroll. คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Builder#title(Component)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:144 - Modifiers:
public - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ title ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: displayName. คืนค่า: this.
Parameters
Component component
ตัวอย่างใช้งาน
CreativeModeTab.Builder instance = ...;
Component component = ...;
CreativeModeTab.Builder result = instance.title(component);
net.minecraft.world.item.CreativeModeTab$Builder#type(CreativeModeTab.Type)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:174 - Modifiers:
protected - Return:
CreativeModeTab.Builder
คืออะไร
ดำเนินการ type ตาม implementation ของ CreativeModeTab$Builder
ทำงานยังไง
แก้ state: type. คืนค่า: this.
Parameters
CreativeModeTab.Type type
ตัวอย่างใช้งาน
CreativeModeTab.Type type = ...;
@Override
protected CreativeModeTab.Builder type(CreativeModeTab.Type type) {
return super.type(type);
}
CreativeModeTab$DisplayItemsGenerator
- Full name:
net.minecraft.world.item.CreativeModeTab$DisplayItemsGenerator - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTab.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.CreativeModeTab$DisplayItemsGenerator#accept(CreativeModeTab.ItemDisplayParameters,CreativeModeTab.Output)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:200 - Modifiers: ``
- Return:
void
คืออะไร
รับค่า accept
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
CreativeModeTab.ItemDisplayParameters itemDisplayParametersCreativeModeTab.Output output
ตัวอย่างใช้งาน
CreativeModeTab.DisplayItemsGenerator instance = ...;
CreativeModeTab.ItemDisplayParameters itemDisplayParameters = ...;
CreativeModeTab.Output output = ...;
instance.accept(itemDisplayParameters, output);
CreativeModeTab$ItemDisplayParameters
- Full name:
net.minecraft.world.item.CreativeModeTab$ItemDisplayParameters - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTab.java - Type:
record - Modifiers:
public
net.minecraft.world.item.CreativeModeTab$ItemDisplayParameters#needsUpdate(FeatureFlagSet,boolean,HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:248 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ needsUpdate ตาม implementation ของ CreativeModeTab$ItemDisplayParameters
ทำงานยังไง
เรียกต่อ: equals(). คืนค่า: !this.enabledFeatures.equals(featureFlagSet) || this.hasPermissions != bl || this.holders != provider.
Parameters
FeatureFlagSet featureFlagSetboolean blHolderLookup.Provider provider
ตัวอย่างใช้งาน
CreativeModeTab.ItemDisplayParameters instance = ...;
FeatureFlagSet featureFlagSet = ...;
HolderLookup.Provider provider = ...;
boolean result = instance.needsUpdate(featureFlagSet, true, provider);
CreativeModeTab$Output
- Full name:
net.minecraft.world.item.CreativeModeTab$Output - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTab.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.CreativeModeTab$Output#accept(ItemLike)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:264 - Modifiers:
default - Return:
void
คืออะไร
รับค่า accept
ทำงานยังไง
สร้างออบเจ็กต์: ItemStack.
Parameters
ItemLike itemLike
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Output#accept(ItemLike,CreativeModeTab.TabVisibility)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:260 - Modifiers:
default - Return:
void
คืออะไร
รับค่า accept
ทำงานยังไง
สร้างออบเจ็กต์: ItemStack.
Parameters
ItemLike itemLikeCreativeModeTab.TabVisibility tabVisibility
ตัวอย่างใช้งาน
CreativeModeTab.Output instance = ...;
ItemLike itemLike = ...;
CreativeModeTab.TabVisibility tabVisibility = ...;
instance.accept(itemLike, tabVisibility);
net.minecraft.world.item.CreativeModeTab$Output#accept(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:256 - Modifiers:
default - Return:
void
คืออะไร
รับค่า accept
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTab$Output#accept(ItemStack,CreativeModeTab.TabVisibility)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:254 - Modifiers: ``
- Return:
void
คืออะไร
รับค่า accept
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ItemStack itemStackCreativeModeTab.TabVisibility tabVisibility
ตัวอย่างใช้งาน
CreativeModeTab.Output instance = ...;
ItemStack itemStack = ...;
CreativeModeTab.TabVisibility tabVisibility = ...;
instance.accept(itemStack, tabVisibility);
net.minecraft.world.item.CreativeModeTab$Output#acceptAll(Collection<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:272 - Modifiers:
default - Return:
void
คืออะไร
รับค่า All
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Collection<ItemStack> collection
ตัวอย่างใช้งาน
CreativeModeTab.Output instance = ...;
Collection<ItemStack> collection = ...;
instance.acceptAll(collection);
net.minecraft.world.item.CreativeModeTab$Output#acceptAll(Collection<ItemStack>,CreativeModeTab.TabVisibility)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTab.java:268 - Modifiers:
default - Return:
void
คืออะไร
รับค่า All
ทำงานยังไง
เรียกต่อ: forEach(), accept().
Parameters
Collection<ItemStack> collectionCreativeModeTab.TabVisibility tabVisibility
ตัวอย่างใช้งาน
CreativeModeTab.Output instance = ...;
Collection<ItemStack> collection = ...;
CreativeModeTab.TabVisibility tabVisibility = ...;
instance.acceptAll(collection, tabVisibility);
CreativeModeTabs
- Full name:
net.minecraft.world.item.CreativeModeTabs - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CreativeModeTabs.java - Type:
class - Modifiers:
public
net.minecraft.world.item.CreativeModeTabs#allTabs()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1977 - Modifiers:
public static - Return:
List<CreativeModeTab>
คืออะไร
ดำเนินการ allTabs ตาม implementation ของ CreativeModeTabs
ทำงานยังไง
เรียกต่อ: streamAllTabs(), toList(). คืนค่า: streamAllTabs().toList().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTabs#bootstrap(Registry<CreativeModeTab>)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:71 - Modifiers:
public static - Return:
CreativeModeTab
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ CreativeModeTabs
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: register(), builder(), title(), translatable(), icon(), displayItems(), accept(), build(). สร้างออบเจ็กต์: ItemStack.
Parameters
Registry<CreativeModeTab> registry
ตัวอย่างใช้งาน
Registry<CreativeModeTab> registry = ...;
CreativeModeTab result = CreativeModeTabs.bootstrap(registry);
net.minecraft.world.item.CreativeModeTabs#getDefaultTab()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1877 - Modifiers:
public static - Return:
CreativeModeTab
คืออะไร
อ่านค่า Default Tab
ทำงานยังไง
เรียกต่อ: getValueOrThrow(). คืนค่า: BuiltInRegistries.CREATIVE_MODE_TAB.getValueOrThrow(BUILDING_BLOCKS).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTabs#searchTab()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1985 - Modifiers:
public static - Return:
CreativeModeTab
คืออะไร
ค้นหา Tab
ทำงานยังไง
เรียกต่อ: getValueOrThrow(). คืนค่า: BuiltInRegistries.CREATIVE_MODE_TAB.getValueOrThrow(SEARCH).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTabs#tabs()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1973 - Modifiers:
public static - Return:
List<CreativeModeTab>
คืออะไร
ดำเนินการ tabs ตาม implementation ของ CreativeModeTabs
ทำงานยังไง
เรียกต่อ: streamAllTabs(), filter(), toList(). คืนค่า: streamAllTabs().filter(CreativeModeTab::shouldDisplay).toList().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CreativeModeTabs#tryRebuildTabContents(FeatureFlagSet,boolean,HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1998 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ tryRebuildTabContents ตาม implementation ของ CreativeModeTabs
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: needsUpdate(), ItemDisplayParameters(), buildAllTabContents(). สร้างออบเจ็กต์: CreativeModeTab.ItemDisplayParameters. มีจุด return อย่างน้อย 2 จุด.
Parameters
FeatureFlagSet featureFlagSetboolean blHolderLookup.Provider provider
ตัวอย่างใช้งาน
FeatureFlagSet featureFlagSet = ...;
HolderLookup.Provider provider = ...;
boolean result = CreativeModeTabs.tryRebuildTabContents(featureFlagSet, true, provider);
net.minecraft.world.item.CreativeModeTabs#validate()
- Origin:
common - Source:
net/minecraft/world/item/CreativeModeTabs.java:1864 - Modifiers:
public static - Return:
void
คืออะไร
ตรวจสอบความถูกต้อง validate
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: registryKeySet(), getValueOrThrow(), getDisplayName(), getString(), put(), of(), row(), column(). สร้างออบเจ็กต์: HashMap<>, IllegalArgumentException.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
CrossbowItem
- Full name:
net.minecraft.world.item.CrossbowItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CrossbowItem.java - Type:
class - Modifiers:
public - Extends:
ProjectileWeaponItem
net.minecraft.world.item.CrossbowItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:258 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ CrossbowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: get(), isEmpty(), getItems(), add(), translatable(), append(), getDisplayName(), isAdvanced().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.CrossbowItem#createProjectile(Level,LivingEntity,ItemStack,ItemStack,boolean)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:163 - Modifiers:
protected - Return:
Projectile
คืออะไร
สร้าง Projectile
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: is(), getX(), getEyeY(), getZ(), setSoundEvent(). สร้างออบเจ็กต์: FireworkRocketEntity. มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelLivingEntity livingEntityItemStack itemStackItemStack itemStack2boolean bl
ตัวอย่างใช้งาน
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
@Override
protected Projectile createProjectile(Level level, LivingEntity livingEntity, ItemStack itemStack, ItemStack itemStack2, boolean bl) {
return super.createProjectile(level, livingEntity, itemStack, itemStack2, bl);
}
net.minecraft.world.item.CrossbowItem#CrossbowItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:54 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ CrossbowItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.CrossbowItem#getAllSupportedProjectiles()
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:63 - Modifiers:
public - Return:
Predicate<ItemStack>
คืออะไร
อ่านค่า All Supported Projectiles
ทำงานยังไง
คืนค่า: ARROW_ONLY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CrossbowItem#getChargeDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:235 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Charge Duration
ทำงานยังไง
เรียกต่อ: modifyCrossbowChargingTime(), floor(). คืนค่า: Mth.floor(f * 20.0F).
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = CrossbowItem.getChargeDuration(itemStack, livingEntity);
net.minecraft.world.item.CrossbowItem#getDefaultProjectileRange()
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:283 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Default Projectile Range
ทำงานยังไง
คืนค่า: 8.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CrossbowItem#getDurabilityUse(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:177 - Modifiers:
protected - Return:
int
คืออะไร
อ่านค่า Durability Use
ทำงานยังไง
เรียกต่อ: is(). คืนค่า: itemStack.is(Items.FIREWORK_ROCKET) ? 3 : 1.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
@Override
protected int getDurabilityUse(ItemStack itemStack) {
return super.getDurabilityUse(itemStack);
}
net.minecraft.world.item.CrossbowItem#getSupportedHeldProjectiles()
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:58 - Modifiers:
public - Return:
Predicate<ItemStack>
คืออะไร
อ่านค่า Supported Held Projectiles
ทำงานยังไง
คืนค่า: ARROW_OR_FIREWORK.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.CrossbowItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:240 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.CROSSBOW.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.CrossbowItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:230 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
เรียกต่อ: getChargeDuration(). คืนค่า: getChargeDuration(itemStack, livingEntity) + 3.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.CrossbowItem#isCharged(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:124 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Charged
ทำงานยังไง
เรียกต่อ: getOrDefault(), isEmpty(). คืนค่า: !chargedProjectiles.isEmpty().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.CrossbowItem#onUseTick(Level,LivingEntity,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:206 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Use Tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: startSoundPlayed, midLoadSoundPlayed. เรียกต่อ: getChargingSounds(), getUseDuration(), getChargeDuration(), start(), ifPresent(), playSound(), getX(), getY().
Parameters
Level levelLivingEntity livingEntityItemStack itemStackint i
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
instance.onUseTick(level, livingEntity, itemStack, 0);
net.minecraft.world.item.CrossbowItem#performShooting(Level,LivingEntity,InteractionHand,ItemStack,float,float,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:182 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ performShooting ตาม implementation ของ CrossbowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: set(), isEmpty(), shoot(), getItems(), trigger(), awardStat(), get(), getItem().
Parameters
Level levelLivingEntity livingEntityInteractionHand interactionHandItemStack itemStackfloat ffloat gLivingEntity livingEntity2
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity2 = ...;
instance.performShooting(level, livingEntity, interactionHand, itemStack, 0.0F, 0.0F, livingEntity2);
net.minecraft.world.item.CrossbowItem#releaseUsing(ItemStack,Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:89 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ CrossbowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getUseDuration(), getPowerForTime(), isCharged(), tryLoadProjectiles(), getChargingSounds(), end(), ifPresent(), playSound(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
boolean result = instance.releaseUsing(itemStack, level, livingEntity, 0);
net.minecraft.world.item.CrossbowItem#shootProjectile(LivingEntity,Projectile,int,float,float,float,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:129 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ shootProjectile ตาม implementation ของ CrossbowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getX(), getZ(), sqrt(), getY(), getProjectileShotVector(), getUpVector(), setAngleAxis(), getViewVector(). สร้างออบเจ็กต์: Vec3, Quaternionf.
Parameters
LivingEntity livingEntityProjectile projectileint ifloat ffloat gfloat hLivingEntity livingEntity2
ตัวอย่างใช้งาน
LivingEntity livingEntity = ...;
Projectile projectile = ...;
LivingEntity livingEntity2 = ...;
@Override
protected void shootProjectile(LivingEntity livingEntity, Projectile projectile, int i, float f, float g, float h, LivingEntity livingEntity2) {
super.shootProjectile(livingEntity, projectile, i, f, g, h, livingEntity2);
}
net.minecraft.world.item.CrossbowItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:68 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: startSoundPlayed, midLoadSoundPlayed. เรียกต่อ: getItemInHand(), get(), isEmpty(), performShooting(), getShootingPower(), getProjectile(), startUsingItem(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.CrossbowItem#useOnRelease(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:278 - Modifiers:
public - Return:
boolean
คืออะไร
ใช้งาน On Release
ทำงานยังไง
เรียกต่อ: is(). คืนค่า: itemStack.is(this).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
CrossbowItem instance = ...;
ItemStack itemStack = ...;
boolean result = instance.useOnRelease(itemStack);
CrossbowItem$ChargeType
- Full name:
net.minecraft.world.item.CrossbowItem$ChargeType - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/CrossbowItem.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.CrossbowItem$ChargeType#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/CrossbowItem.java:300 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
DebugStickItem
- Full name:
net.minecraft.world.item.DebugStickItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DebugStickItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.DebugStickItem#canAttackBlock(BlockState,Level,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/DebugStickItem.java:28 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack Block
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: handleInteraction(), getItemInHand(). คืนค่า: false.
Parameters
BlockState blockStateLevel levelBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
DebugStickItem instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
boolean result = instance.canAttackBlock(blockState, level, blockPos, player);
net.minecraft.world.item.DebugStickItem#DebugStickItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/DebugStickItem.java:24 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DebugStickItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.DebugStickItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/DebugStickItem.java:37 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPlayer(), getLevel(), getClickedPos(), handleInteraction(), getBlockState(), getItemInHand(). มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
DebugStickItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
DiggerItem
- Full name:
net.minecraft.world.item.DiggerItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DiggerItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.DiggerItem#DiggerItem(ToolMaterial,TagKey<Block>,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/DiggerItem.java:9 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DiggerItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: applyToolProperties().
Parameters
ToolMaterial toolMaterialTagKey<Block> tagKeyfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
TagKey<Block> tagKey = ...;
Item.Properties properties = ...;
DiggerItem instance = new DiggerItem(toolMaterial, tagKey, 0.0F, 0.0F, properties);
net.minecraft.world.item.DiggerItem#hurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/DiggerItem.java:13 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
คืนค่า: true.
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
DiggerItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.DiggerItem#postHurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/DiggerItem.java:18 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ DiggerItem
ทำงานยังไง
เรียกต่อ: hurtAndBreak().
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
DiggerItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(itemStack, livingEntity, livingEntity2);
DiscFragmentItem
- Full name:
net.minecraft.world.item.DiscFragmentItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DiscFragmentItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.DiscFragmentItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/DiscFragmentItem.java:13 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ DiscFragmentItem
ทำงานยังไง
เรียกต่อ: add(), getDisplayName(), withStyle().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
DiscFragmentItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.DiscFragmentItem#DiscFragmentItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/DiscFragmentItem.java:9 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DiscFragmentItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.DiscFragmentItem#getDisplayName()
- Origin:
common - Source:
net/minecraft/world/item/DiscFragmentItem.java:18 - Modifiers:
public - Return:
MutableComponent
คืออะไร
อ่านค่า Display Name
ทำงานยังไง
เรียกต่อ: translatable(). คืนค่า: Component.translatable(this.descriptionId + ".desc").
Parameters
- ไม่มี
ตัวอย่างใช้งาน
DispensibleContainerItem
- Full name:
net.minecraft.world.item.DispensibleContainerItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DispensibleContainerItem.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.DispensibleContainerItem#checkExtraContent(Player,Level,ItemStack,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/DispensibleContainerItem.java:10 - Modifiers:
default - Return:
void
คืออะไร
ตรวจสอบ Extra Content
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Player playerLevel levelItemStack itemStackBlockPos blockPos
ตัวอย่างใช้งาน
DispensibleContainerItem instance = ...;
Player player = ...;
Level level = ...;
ItemStack itemStack = ...;
BlockPos blockPos = ...;
instance.checkExtraContent(player, level, itemStack, blockPos);
net.minecraft.world.item.DispensibleContainerItem#emptyContents(Player,Level,BlockPos,BlockHitResult)
- Origin:
common - Source:
net/minecraft/world/item/DispensibleContainerItem.java:13 - Modifiers: ``
- Return:
boolean
คืออะไร
ดำเนินการ emptyContents ตาม implementation ของ DispensibleContainerItem
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Player playerLevel levelBlockPos blockPosBlockHitResult blockHitResult
ตัวอย่างใช้งาน
DispensibleContainerItem instance = ...;
Player player = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockHitResult blockHitResult = ...;
boolean result = instance.emptyContents(player, level, blockPos, blockHitResult);
DoubleHighBlockItem
- Full name:
net.minecraft.world.item.DoubleHighBlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DoubleHighBlockItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.DoubleHighBlockItem#DoubleHighBlockItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/DoubleHighBlockItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DoubleHighBlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
DoubleHighBlockItem instance = new DoubleHighBlockItem(block, properties);
net.minecraft.world.item.DoubleHighBlockItem#placeBlock(BlockPlaceContext,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/DoubleHighBlockItem.java:15 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ placeBlock ตาม implementation ของ DoubleHighBlockItem
ทำงานยังไง
เรียกต่อ: getLevel(), getClickedPos(), above(), isWaterAt(), defaultBlockState(), setBlock(). คืนค่า: super.placeBlock(blockPlaceContext, blockState).
Parameters
BlockPlaceContext blockPlaceContextBlockState blockState
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
BlockState blockState = ...;
@Override
protected boolean placeBlock(BlockPlaceContext blockPlaceContext, BlockState blockState) {
return super.placeBlock(blockPlaceContext, blockState);
}
DyeColor
- Full name:
net.minecraft.world.item.DyeColor - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DyeColor.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.DyeColor#byFireworkColor(int)
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:96 - Modifiers:
public static - Return:
DyeColor
คืออะไร
ดำเนินการ byFireworkColor ตาม implementation ของ DyeColor
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: BY_FIREWORK_COLOR.get(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#byId(int)
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:85 - Modifiers:
public static - Return:
DyeColor
คืออะไร
ดำเนินการ byId ตาม implementation ของ DyeColor
ทำงานยังไง
เรียกต่อ: apply(). คืนค่า: BY_ID.apply(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#byName(String,DyeColor)
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:89 - Modifiers:
public static - Return:
DyeColor
คืออะไร
ดำเนินการ byName ตาม implementation ของ DyeColor
ทำงานยังไง
คืนค่า: dyeColor2 != null ? dyeColor2 : dyeColor.
Parameters
String stringDyeColor dyeColor
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getFireworkColor()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:77 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Firework Color
ทำงานยังไง
คืนค่า: this.fireworkColor.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getId()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:61 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Id
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getMapColor()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:73 - Modifiers:
public - Return:
MapColor
คืออะไร
อ่านค่า Map Color
ทำงานยังไง
คืนค่า: this.mapColor.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getMixedColor(ServerLevel,DyeColor,DyeColor)
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:111 - Modifiers:
public static - Return:
DyeColor
คืออะไร
อ่านค่า Mixed Color
ทำงานยังไง
เรียกต่อ: makeCraftColorInput(), recipeAccess(), getRecipeFor(), map(), value(), assemble(), registryAccess(), filter().
Parameters
ServerLevel serverLevelDyeColor dyeColorDyeColor dyeColor2
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
DyeColor dyeColor = ...;
DyeColor dyeColor2 = ...;
DyeColor result = DyeColor.getMixedColor(serverLevel, dyeColor, dyeColor2);
net.minecraft.world.item.DyeColor#getName()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:65 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:106 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getTextColor()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:81 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Text Color
ทำงานยังไง
คืนค่า: this.textColor.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#getTextureDiffuseColor()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:69 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Texture Diffuse Color
ทำงานยังไง
คืนค่า: this.textureDiffuseColor.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeColor#toString()
- Origin:
common - Source:
net/minecraft/world/item/DyeColor.java:101 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ DyeColor
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
DyeItem
- Full name:
net.minecraft.world.item.DyeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/DyeItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
SignApplicator
net.minecraft.world.item.DyeItem#byColor(DyeColor)
- Origin:
common - Source:
net/minecraft/world/item/DyeItem.java:44 - Modifiers:
public static - Return:
DyeItem
คืออะไร
ดำเนินการ byColor ตาม implementation ของ DyeItem
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: ITEM_BY_COLOR.get(dyeColor).
Parameters
DyeColor dyeColor
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeItem#DyeItem(DyeColor,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/DyeItem.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ DyeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: dyeColor. เรียกต่อ: put().
Parameters
DyeColor dyeColorItem.Properties properties
ตัวอย่างใช้งาน
DyeColor dyeColor = ...;
Item.Properties properties = ...;
DyeItem instance = new DyeItem(dyeColor, properties);
net.minecraft.world.item.DyeItem#getDyeColor()
- Origin:
common - Source:
net/minecraft/world/item/DyeItem.java:40 - Modifiers:
public - Return:
DyeColor
คืออะไร
อ่านค่า Dye Color
ทำงานยังไง
คืนค่า: this.dyeColor.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.DyeItem#interactLivingEntity(ItemStack,Player,LivingEntity,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/DyeItem.java:25 - Modifiers:
public - Return:
InteractionResult
คืออะไร
จัดการ interaction Living Entity
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isAlive(), isSheared(), getColor(), level(), playSound(), setColor(), shrink(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackPlayer playerLivingEntity livingEntityInteractionHand interactionHand
ตัวอย่างใช้งาน
DyeItem instance = ...;
ItemStack itemStack = ...;
Player player = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.interactLivingEntity(itemStack, player, livingEntity, interactionHand);
net.minecraft.world.item.DyeItem#tryApplyToSign(Level,SignBlockEntity,boolean,Player)
- Origin:
common - Source:
net/minecraft/world/item/DyeItem.java:48 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ tryApplyToSign ตาม implementation ของ DyeItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: updateText(), setColor(), getDyeColor(), playSound(), getBlockPos(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelSignBlockEntity signBlockEntityboolean blPlayer player
ตัวอย่างใช้งาน
DyeItem instance = ...;
Level level = ...;
SignBlockEntity signBlockEntity = ...;
Player player = ...;
boolean result = instance.tryApplyToSign(level, signBlockEntity, true, player);
EggItem
- Full name:
net.minecraft.world.item.EggItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EggItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.EggItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/EggItem.java:38 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ EggItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(). สร้างออบเจ็กต์: ThrownEgg. คืนค่า: new ThrownEgg(level, position.x(), position.y(), position.z(), itemStack).
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
EggItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.EggItem#EggItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/EggItem.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EggItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.EggItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/EggItem.java:23 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(), spawnProjectileFromRotation(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
EggItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
EitherHolder
- Full name:
net.minecraft.world.item.EitherHolder - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EitherHolder.java - Type:
record - Modifiers:
public
net.minecraft.world.item.EitherHolder#asEither()
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:38 - Modifiers:
public - Return:
Either<Holder<T>, ResourceKey<T>>
คืออะไร
ดำเนินการ asEither ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: map(), orElseGet(), right(). คืนค่า: this.holder.map(Either::left).orElseGet(() -> Either.right(this.key)).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.EitherHolder#codec(ResourceKey<Registry<T>>,Codec<Holder<T>>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:25 - Modifiers:
public static - Return:
Codec<EitherHolder<T>>
คืออะไร
ดำเนินการ codec ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: either(), comapFlatMap(), error(), identity(), xmap().
Parameters
ResourceKey<Registry<T>> resourceKeyCodec<Holder<T>> codec
ตัวอย่างใช้งาน
ResourceKey<Registry<T>> resourceKey = ...;
Codec<Holder<T>> codec = ...;
Codec<EitherHolder<T>> result = EitherHolder.codec(resourceKey, codec);
net.minecraft.world.item.EitherHolder#EitherHolder(Holder<T>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EitherHolder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: of(), unwrapKey(), orElseThrow().
Parameters
Holder<T> holder
ตัวอย่างใช้งาน
net.minecraft.world.item.EitherHolder#EitherHolder(ResourceKey<T>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:21 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EitherHolder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: empty().
Parameters
ResourceKey<T> resourceKey
ตัวอย่างใช้งาน
net.minecraft.world.item.EitherHolder#fromEither(Either<Holder<T>, ResourceKey<T>>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:42 - Modifiers:
public static - Return:
EitherHolder<T>
คืออะไร
ดำเนินการ fromEither ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: map(). คืนค่า: either.map(EitherHolder::new, EitherHolder::new).
Parameters
Either<Holder<T>, ResourceKey<T>> either
ตัวอย่างใช้งาน
Either<Holder<T>, ResourceKey<T>> either = ...;
EitherHolder<T> result = EitherHolder.fromEither(either);
net.minecraft.world.item.EitherHolder#streamCodec(ResourceKey<Registry<T>>,StreamCodec<RegistryFriendlyByteBuf, Holder<T>>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:32 - Modifiers:
public static - Return:
StreamCodec<RegistryFriendlyByteBuf, EitherHolder<T>>
คืออะไร
ดำเนินการ streamCodec ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: composite(), either(). คืนค่า: StreamCodec.composite(ByteBufCodecs.either(streamCodec, ResourceKey.streamCodec(resourceKey)), EitherHolder::asEither, EitherHolder::fromEither).
Parameters
ResourceKey<Registry<T>> resourceKeyStreamCodec<RegistryFriendlyByteBuf, Holder<T>> streamCodec
ตัวอย่างใช้งาน
ResourceKey<Registry<T>> resourceKey = ...;
StreamCodec<RegistryFriendlyByteBuf, Holder<T>> streamCodec = ...;
StreamCodec<RegistryFriendlyByteBuf, EitherHolder<T>> result = EitherHolder.streamCodec(resourceKey, streamCodec);
net.minecraft.world.item.EitherHolder#unwrap(HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:50 - Modifiers:
public - Return:
Optional<Holder<T>>
คืออะไร
ดำเนินการ unwrap ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: or(), lookupOrThrow(), registryKey(), get(). คืนค่า: this.holder.or(() -> provider.lookupOrThrow(this.key.registryKey()).get(this.key)).
Parameters
HolderLookup.Provider provider
ตัวอย่างใช้งาน
EitherHolder instance = ...;
HolderLookup.Provider provider = ...;
Optional<Holder<T>> result = instance.unwrap(provider);
net.minecraft.world.item.EitherHolder#unwrap(Registry<T>)
- Origin:
common - Source:
net/minecraft/world/item/EitherHolder.java:46 - Modifiers:
public - Return:
Optional<T>
คืออะไร
ดำเนินการ unwrap ตาม implementation ของ EitherHolder
ทำงานยังไง
เรียกต่อ: map(), or(), getOptional(). คืนค่า: this.holder.map(Holder::value).or(() -> registry.getOptional(this.key)).
Parameters
Registry<T> registry
ตัวอย่างใช้งาน
EitherHolder instance = ...;
Registry<T> registry = ...;
Optional<T> result = instance.unwrap(registry);
EmptyMapItem
- Full name:
net.minecraft.world.item.EmptyMapItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EmptyMapItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.EmptyMapItem#EmptyMapItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/EmptyMapItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EmptyMapItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.EmptyMapItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/EmptyMapItem.java:15 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), consume(), awardStat(), get(), level(), playSound(), getSoundSource(), create(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
EmptyMapItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
EndCrystalItem
- Full name:
net.minecraft.world.item.EndCrystalItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EndCrystalItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.EndCrystalItem#EndCrystalItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/EndCrystalItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EndCrystalItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.EndCrystalItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/EndCrystalItem.java:22 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), is(), above(), isEmptyBlock(), getX(), getY(). สร้างออบเจ็กต์: AABB, EndCrystal. มีจุด return อย่างน้อย 4 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
EndCrystalItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
EnderEyeItem
- Full name:
net.minecraft.world.item.EnderEyeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EnderEyeItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.EnderEyeItem#EnderEyeItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/EnderEyeItem.java:30 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EnderEyeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.EnderEyeItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/EnderEyeItem.java:69 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 0.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
EnderEyeItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.EnderEyeItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/EnderEyeItem.java:74 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), getPlayerPOVHitResult(), getType(), getBlockState(), getBlockPos(), is(), startUsingItem(), findNearestMapStructure(). สร้างออบเจ็กต์: EyeOfEnder. มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
EnderEyeItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.EnderEyeItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/EnderEyeItem.java:34 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), is(), getValue(), setValue(), pushEntitiesUp(), setBlock(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
EnderEyeItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
EnderpearlItem
- Full name:
net.minecraft.world.item.EnderpearlItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/EnderpearlItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.EnderpearlItem#EnderpearlItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/EnderpearlItem.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EnderpearlItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.EnderpearlItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/EnderpearlItem.java:21 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(), spawnProjectileFromRotation(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
EnderpearlItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
ExperienceBottleItem
- Full name:
net.minecraft.world.item.ExperienceBottleItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ExperienceBottleItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.ExperienceBottleItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/ExperienceBottleItem.java:43 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ ExperienceBottleItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(). สร้างออบเจ็กต์: ThrownExperienceBottle. คืนค่า: new ThrownExperienceBottle(level, position.x(), position.y(), position.z(), itemStack).
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
ExperienceBottleItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.ExperienceBottleItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/ExperienceBottleItem.java:48 - Modifiers:
public - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
เรียกต่อ: builder(), uncertainty(), power(), build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ExperienceBottleItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.ExperienceBottleItem#ExperienceBottleItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ExperienceBottleItem.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ExperienceBottleItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
ExperienceBottleItem instance = new ExperienceBottleItem(properties);
net.minecraft.world.item.ExperienceBottleItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ExperienceBottleItem.java:21 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(), spawnProjectileFromRotation(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
ExperienceBottleItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
FireChargeItem
- Full name:
net.minecraft.world.item.FireChargeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FireChargeItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.FireChargeItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/FireChargeItem.java:66 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ FireChargeItem
ทำงานยังไง
เรียกต่อ: getRandom(), triangle(), getStepX(), getStepY(), getStepZ(), x(), y(), z(). สร้างออบเจ็กต์: Vec3, SmallFireball. คืนค่า: smallFireball.
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
FireChargeItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.FireChargeItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/FireChargeItem.java:82 - Modifiers:
public - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
เรียกต่อ: builder(), positionFunction(), getDispensePosition(), uncertainty(), power(), overrideDispenseEvent(), build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
FireChargeItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.FireChargeItem#FireChargeItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FireChargeItem.java:26 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FireChargeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.FireChargeItem#shoot(Projectile,double,double,double,float,float)
- Origin:
common - Source:
net/minecraft/world/item/FireChargeItem.java:78 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ shoot ตาม implementation ของ FireChargeItem
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Projectile projectiledouble ddouble edouble ffloat gfloat h
ตัวอย่างใช้งาน
FireChargeItem instance = ...;
Projectile projectile = ...;
instance.shoot(projectile, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
net.minecraft.world.item.FireChargeItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/FireChargeItem.java:30 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), canLight(), relative(), getClickedFace(), canBePlacedAt(), getHorizontalDirection(). มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
FireChargeItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
FireworkRocketItem
- Full name:
net.minecraft.world.item.FireworkRocketItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FireworkRocketItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.FireworkRocketItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:70 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ FireworkRocketItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), addToTooltip().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
FireworkRocketItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.FireworkRocketItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:78 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ FireworkRocketItem
ทำงานยังไง
เรียกต่อ: copyWithCount(), x(), y(), z(). สร้างออบเจ็กต์: FireworkRocketEntity. คืนค่า: new FireworkRocketEntity(level, itemStack.copyWithCount(1), position.x(), position.y(), position.z(), true).
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
FireworkRocketItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.FireworkRocketItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:83 - Modifiers:
public - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
เรียกต่อ: builder(), positionFunction(), uncertainty(), power(), overrideDispenseEvent(), build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
FireworkRocketItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.FireworkRocketItem#FireworkRocketItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:25 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FireworkRocketItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.FireworkRocketItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:54 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isFallFlying(), getItemInHand(), spawnProjectile(), consume(), awardStat(), get(). สร้างออบเจ็กต์: FireworkRocketEntity. มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
FireworkRocketItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.FireworkRocketItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/FireworkRocketItem.java:29 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getItemInHand(), getClickLocation(), getClickedFace(), spawnProjectile(), getPlayer(), getStepX(), getStepY(). สร้างออบเจ็กต์: FireworkRocketEntity. คืนค่า: InteractionResult.SUCCESS.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
FireworkRocketItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
FireworkStarItem
- Full name:
net.minecraft.world.item.FireworkStarItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FireworkStarItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.FireworkStarItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/FireworkStarItem.java:13 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ FireworkStarItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), addToTooltip().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
FireworkStarItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.FireworkStarItem#FireworkStarItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FireworkStarItem.java:9 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FireworkStarItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
FishingRodItem
- Full name:
net.minecraft.world.item.FishingRodItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FishingRodItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.FishingRodItem#FishingRodItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FishingRodItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FishingRodItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.FishingRodItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/FishingRodItem.java:22 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), retrieve(), hurtAndBreak(), getSlotForHand(), playSound(), getX(), getY(), getZ(). สร้างออบเจ็กต์: FishingHook. คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
FishingRodItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
FlintAndSteelItem
- Full name:
net.minecraft.world.item.FlintAndSteelItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FlintAndSteelItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.FlintAndSteelItem#FlintAndSteelItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FlintAndSteelItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FlintAndSteelItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.FlintAndSteelItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/FlintAndSteelItem.java:26 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPlayer(), getLevel(), getClickedPos(), getBlockState(), canLight(), relative(), getClickedFace(), canBePlacedAt(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
FlintAndSteelItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
FoodOnAStickItem
- Full name:
net.minecraft.world.item.FoodOnAStickItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/FoodOnAStickItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.FoodOnAStickItem#FoodOnAStickItem(EntityType<T>,int,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/FoodOnAStickItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ FoodOnAStickItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: canInteractWith, consumeItemDamage.
Parameters
EntityType<T> entityTypeint iItem.Properties properties
ตัวอย่างใช้งาน
EntityType<T> entityType = ...;
Item.Properties properties = ...;
FoodOnAStickItem instance = new FoodOnAStickItem(entityType, 0, properties);
net.minecraft.world.item.FoodOnAStickItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/FoodOnAStickItem.java:24 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), getControlledVehicle(), isPassenger(), getType(), boost(), getSlotForHand(), hurtAndConvertOnBreak(), heldItemTransformedTo(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
FoodOnAStickItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
GameMasterBlockItem
- Full name:
net.minecraft.world.item.GameMasterBlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/GameMasterBlockItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.GameMasterBlockItem#GameMasterBlockItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/GameMasterBlockItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ GameMasterBlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
GameMasterBlockItem instance = new GameMasterBlockItem(block, properties);
net.minecraft.world.item.GameMasterBlockItem#getPlacementState(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/GameMasterBlockItem.java:14 - Modifiers:
protected - Return:
BlockState
คืออะไร
อ่านค่า Placement State
ทำงานยังไง
เรียกต่อ: getPlayer(), canUseGameMasterBlocks(). คืนค่า: player != null && !player.canUseGameMasterBlocks() ? null : super.getPlacementState(blockPlaceContext).
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
@Override
protected BlockState getPlacementState(BlockPlaceContext blockPlaceContext) {
return super.getPlacementState(blockPlaceContext);
}
GlowInkSacItem
- Full name:
net.minecraft.world.item.GlowInkSacItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/GlowInkSacItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
SignApplicator
net.minecraft.world.item.GlowInkSacItem#GlowInkSacItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/GlowInkSacItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ GlowInkSacItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.GlowInkSacItem#tryApplyToSign(Level,SignBlockEntity,boolean,Player)
- Origin:
common - Source:
net/minecraft/world/item/GlowInkSacItem.java:14 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ tryApplyToSign ตาม implementation ของ GlowInkSacItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: updateText(), setHasGlowingText(), playSound(), getBlockPos(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelSignBlockEntity signBlockEntityboolean blPlayer player
ตัวอย่างใช้งาน
GlowInkSacItem instance = ...;
Level level = ...;
SignBlockEntity signBlockEntity = ...;
Player player = ...;
boolean result = instance.tryApplyToSign(level, signBlockEntity, true, player);
HangingEntityItem
- Full name:
net.minecraft.world.item.HangingEntityItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/HangingEntityItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.HangingEntityItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/HangingEntityItem.java:86 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ HangingEntityItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: type. เรียกต่อ: registries(), getOrDefault(), isEmpty(), read(), createSerializationContext(), result(), ifPresentOrElse(), value().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
HangingEntityItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.HangingEntityItem#HangingEntityItem(EntityType<? extends HangingEntity>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/HangingEntityItem.java:28 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ HangingEntityItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: type.
Parameters
EntityType<? extends HangingEntity> entityTypeItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends HangingEntity> entityType = ...;
Item.Properties properties = ...;
HangingEntityItem instance = new HangingEntityItem(entityType, properties);
net.minecraft.world.item.HangingEntityItem#mayPlace(Player,Direction,ItemStack,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/HangingEntityItem.java:82 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ mayPlace ตาม implementation ของ HangingEntityItem
ทำงานยังไง
เรียกต่อ: getAxis(), isVertical(), mayUseItemAt(). คืนค่า: !direction.getAxis().isVertical() && player.mayUseItemAt(blockPos, direction, itemStack).
Parameters
Player playerDirection directionItemStack itemStackBlockPos blockPos
ตัวอย่างใช้งาน
Player player = ...;
Direction direction = ...;
ItemStack itemStack = ...;
BlockPos blockPos = ...;
@Override
protected boolean mayPlace(Player player, Direction direction, ItemStack itemStack, BlockPos blockPos) {
return super.mayPlace(player, direction, itemStack, blockPos);
}
net.minecraft.world.item.HangingEntityItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/HangingEntityItem.java:33 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: type. เรียกต่อ: getClickedPos(), getClickedFace(), relative(), getPlayer(), getItemInHand(), mayPlace(), getLevel(), create(). สร้างออบเจ็กต์: ItemFrame, GlowItemFrame. มีจุด return อย่างน้อย 5 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
HangingEntityItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
HangingSignItem
- Full name:
net.minecraft.world.item.HangingSignItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/HangingSignItem.java - Type:
class - Modifiers:
public - Extends:
SignItem
net.minecraft.world.item.HangingSignItem#canPlace(LevelReader,BlockState,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/HangingSignItem.java:15 - Modifiers:
protected - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Place
ทำงานยังไง
เรียกต่อ: getBlock().
Parameters
LevelReader levelReaderBlockState blockStateBlockPos blockPos
ตัวอย่างใช้งาน
LevelReader levelReader = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
@Override
protected boolean canPlace(LevelReader levelReader, BlockState blockState, BlockPos blockPos) {
return super.canPlace(levelReader, blockState, blockPos);
}
net.minecraft.world.item.HangingSignItem#HangingSignItem(Block,Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/HangingSignItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ HangingSignItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockBlock block2Item.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Block block2 = ...;
Item.Properties properties = ...;
HangingSignItem instance = new HangingSignItem(block, block2, properties);
HoeItem
- Full name:
net.minecraft.world.item.HoeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/HoeItem.java - Type:
class - Modifiers:
public - Extends:
DiggerItem
net.minecraft.world.item.HoeItem#changeIntoState(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/HoeItem.java:72 - Modifiers:
public static - Return:
Consumer<UseOnContext>
คืออะไร
ดำเนินการ changeIntoState ตาม implementation ของ HoeItem
ทำงานยังไง
เรียกต่อ: getLevel(), setBlock(), getClickedPos(), gameEvent(), of(), getPlayer(). คืนค่า: useOnContext -> { useOnContext.getLevel().setBlock(useOnContext.getClickedPos(), blockState, 11).
Parameters
BlockState blockState
ตัวอย่างใช้งาน
net.minecraft.world.item.HoeItem#changeIntoStateAndDropItem(BlockState,ItemLike)
- Origin:
common - Source:
net/minecraft/world/item/HoeItem.java:79 - Modifiers:
public static - Return:
Consumer<UseOnContext>
คืออะไร
ดำเนินการ changeIntoStateAndDropItem ตาม implementation ของ HoeItem
ทำงานยังไง
เรียกต่อ: getLevel(), setBlock(), getClickedPos(), gameEvent(), of(), getPlayer(), popResourceFromFace(), getClickedFace(). สร้างออบเจ็กต์: ItemStack. คืนค่า: useOnContext -> { useOnContext.getLevel().setBlock(useOnContext.getClickedPos(), blockState, 11).
Parameters
BlockState blockStateItemLike itemLike
ตัวอย่างใช้งาน
BlockState blockState = ...;
ItemLike itemLike = ...;
Consumer<UseOnContext> result = HoeItem.changeIntoStateAndDropItem(blockState, itemLike);
net.minecraft.world.item.HoeItem#HoeItem(ToolMaterial,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/HoeItem.java:41 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ HoeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ToolMaterial toolMaterialfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
Item.Properties properties = ...;
HoeItem instance = new HoeItem(toolMaterial, 0.0F, 0.0F, properties);
net.minecraft.world.item.HoeItem#onlyIfAirAbove(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/HoeItem.java:87 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ onlyIfAirAbove ตาม implementation ของ HoeItem
ทำงานยังไง
เรียกต่อ: getClickedFace(), getLevel(), getBlockState(), getClickedPos(), above(), isAir(). คืนค่า: useOnContext.getClickedFace() != Direction.DOWN && useOnContext.getLevel().getBlockState(useOnContext.getClickedPos().above()).isAir().
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
net.minecraft.world.item.HoeItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/HoeItem.java:45 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), get(), getBlockState(), getBlock(), getFirst(), getSecond(), test(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
HoeItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
HoneycombItem
- Full name:
net.minecraft.world.item.HoneycombItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/HoneycombItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
SignApplicator
net.minecraft.world.item.HoneycombItem#canApplyToSign(SignText,Player)
- Origin:
common - Source:
net/minecraft/world/item/HoneycombItem.java:103 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Apply To Sign
ทำงานยังไง
คืนค่า: true.
Parameters
SignText signTextPlayer player
ตัวอย่างใช้งาน
HoneycombItem instance = ...;
SignText signText = ...;
Player player = ...;
boolean result = instance.canApplyToSign(signText, player);
net.minecraft.world.item.HoneycombItem#getWaxed(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/HoneycombItem.java:89 - Modifiers:
public static - Return:
Optional<BlockState>
คืออะไร
อ่านค่า Waxed
ทำงานยังไง
เรียกต่อ: ofNullable(), get(), getBlock(), map(), withPropertiesOf(). คืนค่า: Optional.ofNullable(WAXABLES.get().get(blockState.getBlock())).map(block -> block.withPropertiesOf(blockState)).
Parameters
BlockState blockState
ตัวอย่างใช้งาน
net.minecraft.world.item.HoneycombItem#HoneycombItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/HoneycombItem.java:65 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ HoneycombItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.HoneycombItem#tryApplyToSign(Level,SignBlockEntity,boolean,Player)
- Origin:
common - Source:
net/minecraft/world/item/HoneycombItem.java:93 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ tryApplyToSign ตาม implementation ของ HoneycombItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: setWaxed(), levelEvent(), getBlockPos(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelSignBlockEntity signBlockEntityboolean blPlayer player
ตัวอย่างใช้งาน
HoneycombItem instance = ...;
Level level = ...;
SignBlockEntity signBlockEntity = ...;
Player player = ...;
boolean result = instance.tryApplyToSign(level, signBlockEntity, true, player);
net.minecraft.world.item.HoneycombItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/HoneycombItem.java:69 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), getWaxed(), map(), getPlayer(), getItemInHand(), trigger(). มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
HoneycombItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
InkSacItem
- Full name:
net.minecraft.world.item.InkSacItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/InkSacItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
SignApplicator
net.minecraft.world.item.InkSacItem#InkSacItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/InkSacItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ InkSacItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.InkSacItem#tryApplyToSign(Level,SignBlockEntity,boolean,Player)
- Origin:
common - Source:
net/minecraft/world/item/InkSacItem.java:14 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ tryApplyToSign ตาม implementation ของ InkSacItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: updateText(), setHasGlowingText(), playSound(), getBlockPos(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelSignBlockEntity signBlockEntityboolean blPlayer player
ตัวอย่างใช้งาน
InkSacItem instance = ...;
Level level = ...;
SignBlockEntity signBlockEntity = ...;
Player player = ...;
boolean result = instance.tryApplyToSign(level, signBlockEntity, true, player);
InstrumentItem
- Full name:
net.minecraft.world.item.InstrumentItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/InstrumentItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.InstrumentItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:36 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ InstrumentItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: registries(), getInstrument(), isPresent(), get(), value(), description(), copy(), mergeStyles().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
InstrumentItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.InstrumentItem#create(Item,Holder<Instrument>)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:50 - Modifiers:
public static - Return:
ItemStack
คืออะไร
สร้าง create
ทำงานยังไง
เรียกต่อ: set(). สร้างออบเจ็กต์: ItemStack. คืนค่า: itemStack.
Parameters
Item itemHolder<Instrument> holder
ตัวอย่างใช้งาน
Item item = ...;
Holder<Instrument> holder = ...;
ItemStack result = InstrumentItem.create(item, holder);
net.minecraft.world.item.InstrumentItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:95 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.TOOT_HORN.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
InstrumentItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.InstrumentItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:72 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
เรียกต่อ: getInstrument(), registryAccess(), map(), floor(), value(), useDuration(), orElse(). คืนค่า: optional.<Integer>map(holder -> Mth.floor(holder.value().useDuration() * 20.0F)).orElse(0).
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
InstrumentItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.InstrumentItem#InstrumentItem(TagKey<Instrument>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:31 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ InstrumentItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: instruments.
Parameters
TagKey<Instrument> tagKeyItem.Properties properties
ตัวอย่างใช้งาน
TagKey<Instrument> tagKey = ...;
Item.Properties properties = ...;
InstrumentItem instance = new InstrumentItem(tagKey, properties);
net.minecraft.world.item.InstrumentItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/InstrumentItem.java:56 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), getInstrument(), registryAccess(), isPresent(), get(), value(), startUsingItem(), play(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
InstrumentItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
Instruments
- Full name:
net.minecraft.world.item.Instruments - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Instruments.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.Instruments#bootstrap(BootstrapContext<Instrument>)
- Origin:
common - Source:
net/minecraft/world/item/Instruments.java:30 - Modifiers:
static - Return:
void
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ Instruments
ทำงานยังไง
เรียกต่อ: register(), get().
Parameters
BootstrapContext<Instrument> bootstrapContext
ตัวอย่างใช้งาน
net.minecraft.world.item.Instruments#register(BootstrapContext<Instrument>,ResourceKey<Instrument>,Holder<SoundEvent>,float,float)
- Origin:
common - Source:
net/minecraft/world/item/Instruments.java:41 - Modifiers:
static - Return:
void
คืออะไร
ลงทะเบียน register
ทำงานยังไง
เรียกต่อ: translatable(), makeDescriptionId(), location(). สร้างออบเจ็กต์: Instrument.
Parameters
BootstrapContext<Instrument> bootstrapContextResourceKey<Instrument> resourceKeyHolder<SoundEvent> holderfloat ffloat g
ตัวอย่างใช้งาน
BootstrapContext<Instrument> bootstrapContext = ...;
ResourceKey<Instrument> resourceKey = ...;
Holder<SoundEvent> holder = ...;
Instruments.register(bootstrapContext, resourceKey, holder, 0.0F, 0.0F);
Item
- Full name:
net.minecraft.world.item.Item - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Item.java - Type:
class - Modifiers:
public - Implements:
FeatureElement,ItemLike,FabricItem
net.minecraft.world.item.Item#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:271 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ Item
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.Item#asItem()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:148 - Modifiers:
public - Return:
Item
คืออะไร
ดำเนินการ asItem ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#builtInRegistryHolder()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:122 - Modifiers:
public - Return:
Holder.Reference<Item>
คืออะไร
ดำเนินการ builtInRegistryHolder ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: this.builtInRegistryHolder.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#byBlock(Block)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:104 - Modifiers:
public static - Return:
Item
คืออะไร
ดำเนินการ byBlock ตาม implementation ของ Item
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: BY_BLOCK.getOrDefault(block, Items.AIR).
Parameters
Block block
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#byId(int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:100 - Modifiers:
public static - Return:
Item
คืออะไร
ดำเนินการ byId ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: BuiltInRegistries.ITEM.byId(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#canAttackBlock(BlockState,Level,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:144 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack Block
ทำงานยังไง
คืนค่า: true.
Parameters
BlockState blockStateLevel levelBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
Item instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
boolean result = instance.canAttackBlock(blockState, level, blockPos, player);
net.minecraft.world.item.Item#canFitInsideContainerItems()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:313 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Fit Inside Container Items
ทำงานยังไง
คืนค่า: true.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#components()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:127 - Modifiers:
public - Return:
DataComponentMap
คืออะไร
ดำเนินการ components ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: this.components.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#finishUsingItem(ItemStack,Level,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:173 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ finishUsingItem ตาม implementation ของ Item
ทำงานยังไง
เรียกต่อ: get(), onConsume(). คืนค่า: consumable != null ? consumable.onConsume(level, livingEntity, itemStack) : itemStack.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntity
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack result = instance.finishUsingItem(itemStack, level, livingEntity);
net.minecraft.world.item.Item#getAttackDamageBonus(Entity,float,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:200 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Attack Damage Bonus
ทำงานยังไง
คืนค่า: 0.0F.
Parameters
Entity entityfloat fDamageSource damageSource
ตัวอย่างใช้งาน
Item instance = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = instance.getAttackDamageBonus(entity, 0.0F, damageSource);
net.minecraft.world.item.Item#getBarColor(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:186 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Color
ทำงานยังไง
เรียกต่อ: getMaxDamage(), max(), getDamageValue(), hsvToRgb(). คืนค่า: Mth.hsvToRgb(f / 3.0F, 1.0F, 1.0F).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getBarWidth(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:182 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Width
ทำงานยังไง
เรียกต่อ: clamp(), round(), getDamageValue(), getMaxDamage(). คืนค่า: Mth.clamp(Math.round(13.0F - itemStack.getDamageValue() * 13.0F / itemStack.getMaxDamage()), 0, 13).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getBreakingSound()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:309 - Modifiers:
public - Return:
SoundEvent
คืออะไร
อ่านค่า Breaking Sound
ทำงานยังไง
คืนค่า: SoundEvents.ITEM_BREAK.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getCraftingRemainder()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:243 - Modifiers:
public final - Return:
ItemStack
คืออะไร
อ่านค่า Crafting Remainder
ทำงานยังไง
แก้ state: craftingRemainingItem. สร้างออบเจ็กต์: ItemStack. คืนค่า: this.craftingRemainingItem == null ? ItemStack.EMPTY : new ItemStack(this.craftingRemainingItem).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getDamageSource(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:204 - Modifiers:
public - Return:
DamageSource
คืออะไร
อ่านค่า Damage Source
ทำงานยังไง
คืนค่า: null.
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
Item instance = ...;
LivingEntity livingEntity = ...;
DamageSource result = instance.getDamageSource(livingEntity);
net.minecraft.world.item.Item#getDefaultInstance()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:305 - Modifiers:
public - Return:
ItemStack
คืออะไร
อ่านค่า Default Instance
ทำงานยังไง
สร้างออบเจ็กต์: ItemStack. คืนค่า: new ItemStack(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getDefaultMaxStackSize()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:131 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Default Max Stack Size
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.components.getOrDefault(DataComponents.MAX_STACK_SIZE, 1).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getDescriptionId()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:278 - Modifiers:
public final - Return:
String
คืออะไร
อ่านค่า Description Id
ทำงานยังไง
คืนค่า: this.descriptionId.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getDestroySpeed(ItemStack,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:157 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Destroy Speed
ทำงานยังไง
เรียกต่อ: get(), getMiningSpeed(). คืนค่า: tool != null ? tool.getMiningSpeed(blockState) : 1.0F.
Parameters
ItemStack itemStackBlockState blockState
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
BlockState blockState = ...;
float result = instance.getDestroySpeed(itemStack, blockState);
net.minecraft.world.item.Item#getId(Item)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:96 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Id
ทำงานยังไง
คืนค่า: item == null ? 0 : BuiltInRegistries.ITEM.getId(item).
Parameters
Item item
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getName()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:283 - Modifiers:
public final - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.components.getOrDefault(DataComponents.ITEM_NAME, CommonComponents.EMPTY).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:287 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: getComponents(), getOrDefault(). คืนค่า: itemStack.getComponents().getOrDefault(DataComponents.ITEM_NAME, CommonComponents.EMPTY).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#getPlayerPOVHitResult(Level,Player,ClipContext.Fluid)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:295 - Modifiers:
protected static - Return:
BlockHitResult
คืออะไร
อ่านค่า Player POVHit Result
ทำงานยังไง
เรียกต่อ: getEyePosition(), add(), calculateViewVector(), getXRot(), getYRot(), scale(), blockInteractionRange(), clip(). สร้างออบเจ็กต์: ClipContext. คืนค่า: level.clip(new ClipContext(vec3, vec32, ClipContext.Block.OUTLINE, fluid, player)).
Parameters
Level levelPlayer playerClipContext.Fluid fluid
ตัวอย่างใช้งาน
Level level = ...;
Player player = ...;
ClipContext.Fluid fluid = ...;
@Override
protected BlockHitResult getPlayerPOVHitResult(Level level, Player player, ClipContext.Fluid fluid) {
return super.getPlayerPOVHitResult(level, player, fluid);
}
net.minecraft.world.item.Item#getTooltipImage(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:274 - Modifiers:
public - Return:
Optional<TooltipComponent>
คืออะไร
อ่านค่า Tooltip Image
ทำงานยังไง
เรียกต่อ: empty(). คืนค่า: Optional.empty().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Optional<TooltipComponent> result = instance.getTooltipImage(itemStack);
net.minecraft.world.item.Item#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:257 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
เรียกต่อ: get(), animation(). คืนค่า: consumable != null ? consumable.animation() : ItemUseAnimation.NONE.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.Item#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:262 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
เรียกต่อ: get(), consumeTicks(). คืนค่า: consumable != null ? consumable.consumeTicks() : 0.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.Item#hurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:209 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.Item#interactLivingEntity(ItemStack,Player,LivingEntity,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:234 - Modifiers:
public - Return:
InteractionResult
คืออะไร
จัดการ interaction Living Entity
ทำงานยังไง
คืนค่า: InteractionResult.PASS.
Parameters
ItemStack itemStackPlayer playerLivingEntity livingEntityInteractionHand interactionHand
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Player player = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.interactLivingEntity(itemStack, player, livingEntity, interactionHand);
net.minecraft.world.item.Item#inventoryTick(ItemStack,Level,Entity,int,boolean)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:247 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ inventoryTick ตาม implementation ของ Item
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStackLevel levelEntity entityint iboolean bl
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
Entity entity = ...;
instance.inventoryTick(itemStack, level, entity, 0, true);
net.minecraft.world.item.Item#isBarVisible(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:178 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Bar Visible
ทำงานยังไง
เรียกต่อ: isDamaged(). คืนค่า: itemStack.isDamaged().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#isCorrectToolForDrops(ItemStack,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:229 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Correct Tool For Drops
ทำงานยังไง
เรียกต่อ: get(), isCorrectForDrops(). คืนค่า: tool != null && tool.isCorrectForDrops(blockState).
Parameters
ItemStack itemStackBlockState blockState
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
BlockState blockState = ...;
boolean result = instance.isCorrectToolForDrops(itemStack, blockState);
net.minecraft.world.item.Item#isFoil(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:291 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Foil
ทำงานยังไง
เรียกต่อ: isEnchanted(). คืนค่า: itemStack.isEnchanted().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#Item(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:109 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ Item ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: descriptionId, components, craftingRemainingItem, requiredFeatures. เรียกต่อ: effectiveDescriptionId(), buildAndValidateComponents(), translatable(), effectiveModel(), getClass(), getSimpleName(), endsWith(), error().
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#mineBlock(ItemStack,Level,BlockState,BlockPos,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:216 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ mineBlock ตาม implementation ของ Item
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), getDestroySpeed(), damagePerBlock(), hurtAndBreak(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackLevel levelBlockState blockStateBlockPos blockPosLivingEntity livingEntity
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
LivingEntity livingEntity = ...;
boolean result = instance.mineBlock(itemStack, level, blockState, blockPos, livingEntity);
net.minecraft.world.item.Item#onCraftedBy(ItemStack,Level,Player)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:250 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Crafted By
ทำงานยังไง
เรียกต่อ: onCraftedPostProcess().
Parameters
ItemStack itemStackLevel levelPlayer player
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
Player player = ...;
instance.onCraftedBy(itemStack, level, player);
net.minecraft.world.item.Item#onCraftedPostProcess(ItemStack,Level)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:254 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Crafted Post Process
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStackLevel level
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
instance.onCraftedPostProcess(itemStack, level);
net.minecraft.world.item.Item#onDestroyed(ItemEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:138 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Destroyed
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemEntity itemEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#onUseTick(Level,LivingEntity,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:135 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Use Tick
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Level levelLivingEntity livingEntityItemStack itemStackint i
ตัวอย่างใช้งาน
Item instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
instance.onUseTick(level, livingEntity, itemStack, 0);
net.minecraft.world.item.Item#overrideOtherStackedOnMe(ItemStack,ItemStack,Slot,ClickAction,Player,SlotAccess)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:196 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideOtherStackedOnMe ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStackItemStack itemStack2Slot slotClickAction clickActionPlayer playerSlotAccess slotAccess
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
SlotAccess slotAccess = ...;
boolean result = instance.overrideOtherStackedOnMe(itemStack, itemStack2, slot, clickAction, player, slotAccess);
net.minecraft.world.item.Item#overrideStackedOnOther(ItemStack,Slot,ClickAction,Player)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:192 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideStackedOnOther ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStackSlot slotClickAction clickActionPlayer player
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
boolean result = instance.overrideStackedOnOther(itemStack, slot, clickAction, player);
net.minecraft.world.item.Item#postHurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:213 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ Item
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.Item#releaseUsing(ItemStack,Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:267 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
boolean result = instance.releaseUsing(itemStack, level, livingEntity, 0);
net.minecraft.world.item.Item#requiredFeatures()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:317 - Modifiers:
public - Return:
FeatureFlagSet
คืออะไร
ดำเนินการ requiredFeatures ตาม implementation ของ Item
ทำงานยังไง
คืนค่า: this.requiredFeatures.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#shouldPrintOpWarning(ItemStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:322 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าควร Print Op Warning
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStackPlayer player
ตัวอย่างใช้งาน
Item instance = ...;
ItemStack itemStack = ...;
Player player = ...;
boolean result = instance.shouldPrintOpWarning(itemStack, player);
net.minecraft.world.item.Item#toString()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:238 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ Item
ทำงานยังไง
เรียกต่อ: wrapAsHolder(), getRegisteredName(). คืนค่า: BuiltInRegistries.ITEM.wrapAsHolder(this).getRegisteredName().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:162 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), get(), startConsuming(), swappable(), swapWithEquipmentSlot(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
Item instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.Item#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:153 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
คืนค่า: InteractionResult.PASS.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
Item instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
net.minecraft.world.item.Item#useOnRelease(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:301 - Modifiers:
public - Return:
boolean
คืออะไร
ใช้งาน On Release
ทำงานยังไง
คืนค่า: false.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.Item#verifyComponentsAfterLoad(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:141 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ verifyComponentsAfterLoad ตาม implementation ของ Item
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Item$Properties
- Full name:
net.minecraft.world.item.Item$Properties - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Item.java - Type:
class - Modifiers:
public static - Implements:
Settings
net.minecraft.world.item.Item$Properties#attributes(ItemAttributeModifiers)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:444 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ attributes ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). คืนค่า: this.component(DataComponents.ATTRIBUTE_MODIFIERS, itemAttributeModifiers).
Parameters
ItemAttributeModifiers itemAttributeModifiers
ตัวอย่างใช้งาน
Item.Properties instance = ...;
ItemAttributeModifiers itemAttributeModifiers = ...;
Item.Properties result = instance.attributes(itemAttributeModifiers);
net.minecraft.world.item.Item$Properties#component(DataComponentType<T>,T)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:439 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ component ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: set(). คืนค่า: this.
Parameters
DataComponentType<T> dataComponentTypeT object
ตัวอย่างใช้งาน
Item.Properties instance = ...;
DataComponentType<T> dataComponentType = ...;
T object = ...;
Item.Properties result = instance.component(dataComponentType, object);
net.minecraft.world.item.Item$Properties#craftRemainder(Item)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:368 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ craftRemainder ตาม implementation ของ Item$Properties
ทำงานยังไง
แก้ state: craftingRemainingItem. คืนค่า: this.
Parameters
Item item
ตัวอย่างใช้งาน
Item.Properties instance = ...;
Item item = ...;
Item.Properties result = instance.craftRemainder(item);
net.minecraft.world.item.Item$Properties#durability(int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:361 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ durability ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). คืนค่า: this.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#effectiveDescriptionId()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:431 - Modifiers:
protected - Return:
String
คืออะไร
ดำเนินการ effectiveDescriptionId ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: get(), requireNonNull(). คืนค่า: this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set")).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#effectiveModel()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:435 - Modifiers:
public - Return:
ResourceLocation
คืออะไร
ดำเนินการ effectiveModel ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: get(), requireNonNull(). คืนค่า: this.model.get(Objects.requireNonNull(this.id, "Item id not set")).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#enchantable(int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:385 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ enchantable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). สร้างออบเจ็กต์: Enchantable. คืนค่า: this.component(DataComponents.ENCHANTABLE, new Enchantable(i)).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#equippable(EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:398 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ equippable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(), builder(), build(). คืนค่า: this.component(DataComponents.EQUIPPABLE, Equippable.builder(equipmentSlot).build()).
Parameters
EquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
Item.Properties instance = ...;
EquipmentSlot equipmentSlot = ...;
Item.Properties result = instance.equippable(equipmentSlot);
net.minecraft.world.item.Item$Properties#equippableUnswappable(EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:402 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ equippableUnswappable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(), builder(), setSwappable(), build(). คืนค่า: this.component(DataComponents.EQUIPPABLE, Equippable.builder(equipmentSlot).setSwappable(false).build()).
Parameters
EquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
Item.Properties instance = ...;
EquipmentSlot equipmentSlot = ...;
Item.Properties result = instance.equippableUnswappable(equipmentSlot);
net.minecraft.world.item.Item$Properties#fireResistant()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:377 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ fireResistant ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). สร้างออบเจ็กต์: DamageResistant. คืนค่า: this.component(DataComponents.DAMAGE_RESISTANT, new DamageResistant(DamageTypeTags.IS_FIRE)).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#food(FoodProperties)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:341 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ food ตาม implementation ของ Item$Properties
ทำงานยังไง
คืนค่า: this.food(foodProperties, Consumables.DEFAULT_FOOD).
Parameters
FoodProperties foodProperties
ตัวอย่างใช้งาน
Item.Properties instance = ...;
FoodProperties foodProperties = ...;
Item.Properties result = instance.food(foodProperties);
net.minecraft.world.item.Item$Properties#food(FoodProperties,Consumable)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:345 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ food ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). คืนค่า: this.component(DataComponents.FOOD, foodProperties).component(DataComponents.CONSUMABLE, consumable).
Parameters
FoodProperties foodPropertiesConsumable consumable
ตัวอย่างใช้งาน
Item.Properties instance = ...;
FoodProperties foodProperties = ...;
Consumable consumable = ...;
Item.Properties result = instance.food(foodProperties, consumable);
net.minecraft.world.item.Item$Properties#jukeboxPlayable(ResourceKey<JukeboxSong>)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:381 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ jukeboxPlayable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). สร้างออบเจ็กต์: JukeboxPlayable, EitherHolder<>. คืนค่า: this.component(DataComponents.JUKEBOX_PLAYABLE, new JukeboxPlayable(new EitherHolder<>(resourceKey), true)).
Parameters
ResourceKey<JukeboxSong> resourceKey
ตัวอย่างใช้งาน
Item.Properties instance = ...;
ResourceKey<JukeboxSong> resourceKey = ...;
Item.Properties result = instance.jukeboxPlayable(resourceKey);
net.minecraft.world.item.Item$Properties#overrideDescription(String)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:416 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ overrideDescription ตาม implementation ของ Item$Properties
ทำงานยังไง
แก้ state: descriptionId. เรียกต่อ: fixed(). คืนค่า: this.
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#rarity(Rarity)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:373 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ rarity ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). คืนค่า: this.component(DataComponents.RARITY, rarity).
Parameters
Rarity rarity
ตัวอย่างใช้งาน
Item.Properties instance = ...;
Rarity rarity = ...;
Item.Properties result = instance.rarity(rarity);
net.minecraft.world.item.Item$Properties#repairable(Item)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:389 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ repairable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(), direct(), builtInRegistryHolder(). สร้างออบเจ็กต์: Repairable. คืนค่า: this.component(DataComponents.REPAIRABLE, new Repairable(HolderSet.direct(item.builtInRegistryHolder()))).
Parameters
Item item
ตัวอย่างใช้งาน
Item.Properties instance = ...;
Item item = ...;
Item.Properties result = instance.repairable(item);
net.minecraft.world.item.Item$Properties#repairable(TagKey<Item>)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:393 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ repairable ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: acquireBootstrapRegistrationLookup(), component(), getOrThrow(). สร้างออบเจ็กต์: Repairable. คืนค่า: this.component(DataComponents.REPAIRABLE, new Repairable(holderGetter.getOrThrow(tagKey))).
Parameters
TagKey<Item> tagKey
ตัวอย่างใช้งาน
Item.Properties instance = ...;
TagKey<Item> tagKey = ...;
Item.Properties result = instance.repairable(tagKey);
net.minecraft.world.item.Item$Properties#requiredFeatures(FeatureFlag[])
- Origin:
common - Source:
net/minecraft/world/item/Item.java:406 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ requiredFeatures ตาม implementation ของ Item$Properties
ทำงานยังไง
แก้ state: requiredFeatures. เรียกต่อ: subset(). คืนค่า: this.
Parameters
FeatureFlag[] featureFlags
ตัวอย่างใช้งาน
Item.Properties instance = ...;
FeatureFlag[] featureFlags = ...;
Item.Properties result = instance.requiredFeatures(featureFlags);
net.minecraft.world.item.Item$Properties#setId(ResourceKey<Item>)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:411 - Modifiers:
public - Return:
Item.Properties
คืออะไร
กำหนดค่า Id
ทำงานยังไง
แก้ state: id. คืนค่า: this.
Parameters
ResourceKey<Item> resourceKey
ตัวอย่างใช้งาน
Item.Properties instance = ...;
ResourceKey<Item> resourceKey = ...;
Item.Properties result = instance.setId(resourceKey);
net.minecraft.world.item.Item$Properties#stacksTo(int)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:357 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ stacksTo ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). คืนค่า: this.component(DataComponents.MAX_STACK_SIZE, i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#useBlockDescriptionPrefix()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:421 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ใช้งาน Block Description Prefix
ทำงานยังไง
แก้ state: descriptionId. คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#useCooldown(float)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:353 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ใช้งาน Cooldown
ทำงานยังไง
เรียกต่อ: component(). สร้างออบเจ็กต์: UseCooldown. คืนค่า: this.component(DataComponents.USE_COOLDOWN, new UseCooldown(f)).
Parameters
float f
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#useItemDescriptionPrefix()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:426 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ใช้งาน Item Description Prefix
ทำงานยังไง
แก้ state: descriptionId. คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$Properties#usingConvertsTo(Item)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:349 - Modifiers:
public - Return:
Item.Properties
คืออะไร
ดำเนินการ usingConvertsTo ตาม implementation ของ Item$Properties
ทำงานยังไง
เรียกต่อ: component(). สร้างออบเจ็กต์: UseRemainder, ItemStack. คืนค่า: this.component(DataComponents.USE_REMAINDER, new UseRemainder(new ItemStack(item))).
Parameters
Item item
ตัวอย่างใช้งาน
Item.Properties instance = ...;
Item item = ...;
Item.Properties result = instance.usingConvertsTo(item);
Item$TooltipContext
- Full name:
net.minecraft.world.item.Item$TooltipContext - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Item.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.Item$TooltipContext#mapData(MapId)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:483 - Modifiers: ``
- Return:
MapItemSavedData
คืออะไร
ดำเนินการ mapData ตาม implementation ของ Item$TooltipContext
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
MapId mapId
ตัวอย่างใช้งาน
Item.TooltipContext instance = ...;
MapId mapId = ...;
MapItemSavedData result = instance.mapData(mapId);
net.minecraft.world.item.Item$TooltipContext#of(HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:505 - Modifiers:
static - Return:
Item.TooltipContext
คืออะไร
ดำเนินการ of ตาม implementation ของ Item$TooltipContext
ทำงานยังไง
เรียกต่อ: TooltipContext(), registries(), tickRate(), mapData(). สร้างออบเจ็กต์: Item.TooltipContext. มีจุด return อย่างน้อย 3 จุด.
Parameters
HolderLookup.Provider provider
ตัวอย่างใช้งาน
HolderLookup.Provider provider = ...;
Item.TooltipContext result = Item.TooltipContext.of(provider);
net.minecraft.world.item.Item$TooltipContext#of(Level)
- Origin:
common - Source:
net/minecraft/world/item/Item.java:486 - Modifiers:
static - Return:
Item.TooltipContext
คืออะไร
ดำเนินการ of ตาม implementation ของ Item$TooltipContext
ทำงานยังไง
เรียกต่อ: TooltipContext(), registries(), registryAccess(), tickRate(), tickRateManager(), tickrate(), mapData(), getMapData(). สร้างออบเจ็กต์: Item.TooltipContext. มีจุด return อย่างน้อย 3 จุด.
Parameters
Level level
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$TooltipContext#registries()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:478 - Modifiers: ``
- Return:
HolderLookup.Provider
คืออะไร
ดำเนินการ registries ตาม implementation ของ Item$TooltipContext
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Item$TooltipContext#tickRate()
- Origin:
common - Source:
net/minecraft/world/item/Item.java:481 - Modifiers: ``
- Return:
float
คืออะไร
ประมวลผล tick Rate
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemCooldowns
- Full name:
net.minecraft.world.item.ItemCooldowns - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemCooldowns.java - Type:
class - Modifiers:
public
net.minecraft.world.item.ItemCooldowns#addCooldown(ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:54 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Cooldown
ทำงานยังไง
เรียกต่อ: getCooldownGroup().
Parameters
ItemStack itemStackint i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemCooldowns#addCooldown(ResourceLocation,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:58 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Cooldown
ทำงานยังไง
เรียกต่อ: put(), CooldownInstance(), onCooldownStarted(). สร้างออบเจ็กต์: ItemCooldowns.CooldownInstance.
Parameters
ResourceLocation resourceLocationint i
ตัวอย่างใช้งาน
ItemCooldowns instance = ...;
ResourceLocation resourceLocation = ...;
instance.addCooldown(resourceLocation, 0);
net.minecraft.world.item.ItemCooldowns#getCooldownGroup(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:48 - Modifiers:
public - Return:
ResourceLocation
คืออะไร
อ่านค่า Cooldown Group
ทำงานยังไง
เรียกต่อ: get(), getKey(), getItem(), cooldownGroup(), orElse(). คืนค่า: useCooldown == null ? resourceLocation : useCooldown.cooldownGroup().orElse(resourceLocation).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemCooldowns instance = ...;
ItemStack itemStack = ...;
ResourceLocation result = instance.getCooldownGroup(itemStack);
net.minecraft.world.item.ItemCooldowns#getCooldownPercent(ItemStack,float)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:21 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Cooldown Percent
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCooldownGroup(), get(), clamp(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackfloat f
ตัวอย่างใช้งาน
ItemCooldowns instance = ...;
ItemStack itemStack = ...;
float result = instance.getCooldownPercent(itemStack, 0.0F);
net.minecraft.world.item.ItemCooldowns#isOnCooldown(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:17 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ On Cooldown
ทำงานยังไง
เรียกต่อ: getCooldownPercent(). คืนค่า: this.getCooldownPercent(itemStack, 0.0F) > 0.0F.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemCooldowns instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isOnCooldown(itemStack);
net.minecraft.world.item.ItemCooldowns#onCooldownEnded(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:71 - Modifiers:
protected - Return:
void
คืออะไร
จัดการเหตุการณ์ Cooldown Ended
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
ResourceLocation resourceLocation = ...;
@Override
protected void onCooldownEnded(ResourceLocation resourceLocation) {
super.onCooldownEnded(resourceLocation);
}
net.minecraft.world.item.ItemCooldowns#onCooldownStarted(ResourceLocation,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:68 - Modifiers:
protected - Return:
void
คืออะไร
จัดการเหตุการณ์ Cooldown Started
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ResourceLocation resourceLocationint i
ตัวอย่างใช้งาน
ResourceLocation resourceLocation = ...;
@Override
protected void onCooldownStarted(ResourceLocation resourceLocation, int i) {
super.onCooldownStarted(resourceLocation, i);
}
net.minecraft.world.item.ItemCooldowns#removeCooldown(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:63 - Modifiers:
public - Return:
void
คืออะไร
ลบ Cooldown
ทำงานยังไง
เรียกต่อ: remove(), onCooldownEnded().
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
ItemCooldowns instance = ...;
ResourceLocation resourceLocation = ...;
instance.removeCooldown(resourceLocation);
net.minecraft.world.item.ItemCooldowns#tick()
- Origin:
common - Source:
net/minecraft/world/item/ItemCooldowns.java:33 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผล tick tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: tickCount. เรียกต่อ: isEmpty(), entrySet(), iterator(), hasNext(), next(), getValue(), remove(), onCooldownEnded().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemDisplayContext
- Full name:
net.minecraft.world.item.ItemDisplayContext - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemDisplayContext.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.ItemDisplayContext#firstPerson()
- Origin:
common - Source:
net/minecraft/world/item/ItemDisplayContext.java:38 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ firstPerson ตาม implementation ของ ItemDisplayContext
ทำงานยังไง
คืนค่า: this == FIRST_PERSON_LEFT_HAND || this == FIRST_PERSON_RIGHT_HAND.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemDisplayContext#getId()
- Origin:
common - Source:
net/minecraft/world/item/ItemDisplayContext.java:34 - Modifiers:
public - Return:
byte
คืออะไร
อ่านค่า Id
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemDisplayContext#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/ItemDisplayContext.java:29 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemFrameItem
- Full name:
net.minecraft.world.item.ItemFrameItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemFrameItem.java - Type:
class - Modifiers:
public - Extends:
HangingEntityItem
net.minecraft.world.item.ItemFrameItem#ItemFrameItem(EntityType<? extends HangingEntity>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ItemFrameItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemFrameItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
EntityType<? extends HangingEntity> entityTypeItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends HangingEntity> entityType = ...;
Item.Properties properties = ...;
ItemFrameItem instance = new ItemFrameItem(entityType, properties);
net.minecraft.world.item.ItemFrameItem#mayPlace(Player,Direction,ItemStack,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/ItemFrameItem.java:14 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ mayPlace ตาม implementation ของ ItemFrameItem
ทำงานยังไง
เรียกต่อ: level(), isOutsideBuildHeight(), mayUseItemAt(). คืนค่า: !player.level().isOutsideBuildHeight(blockPos) && player.mayUseItemAt(blockPos, direction, itemStack).
Parameters
Player playerDirection directionItemStack itemStackBlockPos blockPos
ตัวอย่างใช้งาน
Player player = ...;
Direction direction = ...;
ItemStack itemStack = ...;
BlockPos blockPos = ...;
@Override
protected boolean mayPlace(Player player, Direction direction, ItemStack itemStack, BlockPos blockPos) {
return super.mayPlace(player, direction, itemStack, blockPos);
}
Items
- Full name:
net.minecraft.world.item.Items - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Items.java - Type:
class - Modifiers:
public
net.minecraft.world.item.Items#registerBlock(Block)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2158 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
คืนค่า: registerBlock(block, BlockItem::new).
Parameters
Block block
ตัวอย่างใช้งาน
net.minecraft.world.item.Items#registerBlock(Block,BiFunction<Block, Item.Properties, Item>)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2180 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
เรียกต่อ: Properties(). สร้างออบเจ็กต์: Item.Properties. คืนค่า: registerBlock(block, biFunction, new Item.Properties()).
Parameters
Block blockBiFunction<Block, Item.Properties, Item> biFunction
ตัวอย่างใช้งาน
Block block = ...;
BiFunction<Block, Item.Properties, Item> biFunction = ...;
Item result = Items.registerBlock(block, biFunction);
net.minecraft.world.item.Items#registerBlock(Block,BiFunction<Block, Item.Properties, Item>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2184 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
เรียกต่อ: registerItem(), blockIdToItemId(), builtInRegistryHolder(), key(), apply(), useBlockDescriptionPrefix().
Parameters
Block blockBiFunction<Block, Item.Properties, Item> biFunctionItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
BiFunction<Block, Item.Properties, Item> biFunction = ...;
Item.Properties properties = ...;
Item result = Items.registerBlock(block, biFunction, properties);
net.minecraft.world.item.Items#registerBlock(Block,Block[])
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2170 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
มีการวนลูป. เรียกต่อ: put(). คืนค่า: item.
Parameters
Block blockBlock[] blocks
ตัวอย่างใช้งาน
net.minecraft.world.item.Items#registerBlock(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2162 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
คืนค่า: registerBlock(block, BlockItem::new, properties).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
Item result = Items.registerBlock(block, properties);
net.minecraft.world.item.Items#registerBlock(Block,UnaryOperator<Item.Properties>)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2166 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Block
ทำงานยังไง
เรียกต่อ: apply(). สร้างออบเจ็กต์: BlockItem. คืนค่า: registerBlock(block, (blockx, properties) -> new BlockItem(blockx, unaryOperator.apply(properties))).
Parameters
Block blockUnaryOperator<Item.Properties> unaryOperator
ตัวอย่างใช้งาน
Block block = ...;
UnaryOperator<Item.Properties> unaryOperator = ...;
Item result = Items.registerBlock(block, unaryOperator);
net.minecraft.world.item.Items#registerItem(ResourceKey<Item>,Function<Item.Properties, Item>)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2206 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
เรียกต่อ: Properties(). สร้างออบเจ็กต์: Item.Properties. คืนค่า: registerItem(resourceKey, function, new Item.Properties()).
Parameters
ResourceKey<Item> resourceKeyFunction<Item.Properties, Item> function
ตัวอย่างใช้งาน
ResourceKey<Item> resourceKey = ...;
Function<Item.Properties, Item> function = ...;
Item result = Items.registerItem(resourceKey, function);
net.minecraft.world.item.Items#registerItem(ResourceKey<Item>,Function<Item.Properties, Item>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2210 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: apply(), setId(), registerBlocks(), register(). คืนค่า: Registry.register(BuiltInRegistries.ITEM, resourceKey, item).
Parameters
ResourceKey<Item> resourceKeyFunction<Item.Properties, Item> functionItem.Properties properties
ตัวอย่างใช้งาน
ResourceKey<Item> resourceKey = ...;
Function<Item.Properties, Item> function = ...;
Item.Properties properties = ...;
Item result = Items.registerItem(resourceKey, function, properties);
net.minecraft.world.item.Items#registerItem(String)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2202 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
เรียกต่อ: vanillaItemId(), Properties(). สร้างออบเจ็กต์: Item.Properties. คืนค่า: registerItem(vanillaItemId(string), Item::new, new Item.Properties()).
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.item.Items#registerItem(String,Function<Item.Properties, Item>)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2190 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
เรียกต่อ: vanillaItemId(), Properties(). สร้างออบเจ็กต์: Item.Properties. คืนค่า: registerItem(vanillaItemId(string), function, new Item.Properties()).
Parameters
String stringFunction<Item.Properties, Item> function
ตัวอย่างใช้งาน
Function<Item.Properties, Item> function = ...;
Item result = Items.registerItem("value", function);
net.minecraft.world.item.Items#registerItem(String,Function<Item.Properties, Item>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2194 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
เรียกต่อ: vanillaItemId(). คืนค่า: registerItem(vanillaItemId(string), function, properties).
Parameters
String stringFunction<Item.Properties, Item> functionItem.Properties properties
ตัวอย่างใช้งาน
Function<Item.Properties, Item> function = ...;
Item.Properties properties = ...;
Item result = Items.registerItem("value", function, properties);
net.minecraft.world.item.Items#registerItem(String,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/Items.java:2198 - Modifiers:
public static - Return:
Item
คืออะไร
ลงทะเบียน Item
ทำงานยังไง
เรียกต่อ: vanillaItemId(). คืนค่า: registerItem(vanillaItemId(string), Item::new, properties).
Parameters
String stringItem.Properties properties
ตัวอย่างใช้งาน
ItemStack
- Full name:
net.minecraft.world.item.ItemStack - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemStack.java - Type:
class - Modifiers:
public final - Implements:
DataComponentHolder,FabricItemStack
net.minecraft.world.item.ItemStack#applyComponents(DataComponentMap)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:762 - Modifiers:
public - Return:
void
คืออะไร
นำไปใช้ Components
ทำงานยังไง
เรียกต่อ: setAll(), getItem(), verifyComponentsAfterLoad().
Parameters
DataComponentMap dataComponentMap
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentMap dataComponentMap = ...;
instance.applyComponents(dataComponentMap);
net.minecraft.world.item.ItemStack#applyComponents(DataComponentPatch)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:757 - Modifiers:
public - Return:
void
คืออะไร
นำไปใช้ Components
ทำงานยังไง
เรียกต่อ: applyPatch(), getItem(), verifyComponentsAfterLoad().
Parameters
DataComponentPatch dataComponentPatch
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentPatch dataComponentPatch = ...;
instance.applyComponents(dataComponentPatch);
net.minecraft.world.item.ItemStack#applyComponentsAndValidate(DataComponentPatch)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:745 - Modifiers:
public - Return:
void
คืออะไร
นำไปใช้ Components And Validate
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: asPatch(), applyPatch(), validateStrict(), error(), isPresent(), get(), message(), restorePatch().
Parameters
DataComponentPatch dataComponentPatch
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentPatch dataComponentPatch = ...;
instance.applyComponentsAndValidate(dataComponentPatch);
net.minecraft.world.item.ItemStack#canBeHurtBy(DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1108 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Be Hurt By
ทำงานยังไง
เรียกต่อ: get(), isResistantTo(). คืนค่า: damageResistant == null || !damageResistant.isResistantTo(damageSource).
Parameters
DamageSource damageSource
ตัวอย่างใช้งาน
ItemStack instance = ...;
DamageSource damageSource = ...;
boolean result = instance.canBeHurtBy(damageSource);
net.minecraft.world.item.ItemStack#canBreakBlockInAdventureMode(BlockInWorld)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1044 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Break Block In Adventure Mode
ทำงานยังไง
เรียกต่อ: get(), test(). คืนค่า: adventureModePredicate != null && adventureModePredicate.test(blockInWorld).
Parameters
BlockInWorld blockInWorld
ตัวอย่างใช้งาน
ItemStack instance = ...;
BlockInWorld blockInWorld = ...;
boolean result = instance.canBreakBlockInAdventureMode(blockInWorld);
net.minecraft.world.item.ItemStack#canPlaceOnBlockInAdventureMode(BlockInWorld)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1039 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Place On Block In Adventure Mode
ทำงานยังไง
เรียกต่อ: get(), test(). คืนค่า: adventureModePredicate != null && adventureModePredicate.test(blockInWorld).
Parameters
BlockInWorld blockInWorld
ตัวอย่างใช้งาน
ItemStack instance = ...;
BlockInWorld blockInWorld = ...;
boolean result = instance.canPlaceOnBlockInAdventureMode(blockInWorld);
net.minecraft.world.item.ItemStack#consume(int,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1079 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ consume ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: hasInfiniteMaterials(), shrink().
Parameters
int iLivingEntity livingEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#consumeAndReturn(int,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1085 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ consumeAndReturn ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: copyWithCount(), consume(). คืนค่า: itemStack.
Parameters
int iLivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack instance = ...;
LivingEntity livingEntity = ...;
ItemStack result = instance.consumeAndReturn(0, livingEntity);
net.minecraft.world.item.ItemStack#copy()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:586 - Modifiers:
public - Return:
ItemStack
คืออะไร
คัดลอก copy
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), getItem(), setPopTime(), getPopTime(). สร้างออบเจ็กต์: ItemStack. มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#copyAndClear()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:317 - Modifiers:
public - Return:
ItemStack
คืออะไร
คัดลอก And Clear
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), copy(), setCount(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#copyWithCount(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:596 - Modifiers:
public - Return:
ItemStack
คืออะไร
คัดลอก With Count
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), copy(), setCount(). มีจุด return อย่างน้อย 2 จุด.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#enchant(Holder<Enchantment>,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:980 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ enchant ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: updateEnchantments(), upgrade().
Parameters
Holder<Enchantment> holderint i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#finishUsingItem(Level,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:392 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ finishUsingItem ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: copy(), getItem(), applyAfterUseComponentSideEffects(). คืนค่า: itemStack2.applyAfterUseComponentSideEffects(livingEntity, itemStack).
Parameters
Level levelLivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack result = instance.finishUsingItem(level, livingEntity);
net.minecraft.world.item.ItemStack#forEachModifier(EquipmentSlot,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1018 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ forEachModifier ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getOrDefault(), forEach().
Parameters
EquipmentSlot equipmentSlotBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemStack instance = ...;
EquipmentSlot equipmentSlot = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
instance.forEachModifier(equipmentSlot, biConsumer);
net.minecraft.world.item.ItemStack#forEachModifier(EquipmentSlotGroup,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1012 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ forEachModifier ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getOrDefault(), forEach().
Parameters
EquipmentSlotGroup equipmentSlotGroupBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemStack instance = ...;
EquipmentSlotGroup equipmentSlotGroup = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
instance.forEachModifier(equipmentSlotGroup, biConsumer);
net.minecraft.world.item.ItemStack#getBarColor()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:542 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Color
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getBarColor(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getBarWidth()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:538 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Bar Width
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getBarWidth(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getBreakingSound()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1104 - Modifiers:
public - Return:
SoundEvent
คืออะไร
อ่านค่า Breaking Sound
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getBreakingSound().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getComponents()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:222 - Modifiers:
public - Return:
DataComponentMap
คืออะไร
อ่านค่า Components
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: !this.isEmpty() ? this.components : DataComponentMap.EMPTY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getComponentsPatch()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:231 - Modifiers:
public - Return:
DataComponentPatch
คืออะไร
อ่านค่า Components Patch
ทำงานยังไง
เรียกต่อ: isEmpty(), asPatch(). คืนค่า: !this.isEmpty() ? this.components.asPatch() : DataComponentPatch.EMPTY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getCount()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1057 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Count
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: this.isEmpty() ? 0 : this.count.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getCustomName()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:772 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Custom Name
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), title(), raw(), isBlank(), literal(). มีจุด return อย่างน้อย 3 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getDamageValue()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:450 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Damage Value
ทำงานยังไง
เรียกต่อ: clamp(), getOrDefault(), getMaxDamage(). คืนค่า: Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getDestroySpeed(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:375 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Destroy Speed
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getDestroySpeed(this, blockState).
Parameters
BlockState blockState
ตัวอย่างใช้งาน
ItemStack instance = ...;
BlockState blockState = ...;
float result = instance.getDestroySpeed(blockState);
net.minecraft.world.item.ItemStack#getDisplayName()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1024 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Display Name
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: empty(), append(), getHoverName(), has(), withStyle(), wrapInSquareBrackets(), isEmpty(), getRarity(). สร้างออบเจ็กต์: HoverEvent, HoverEvent.ItemStackInfo. คืนค่า: mutableComponent2.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getEnchantments()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:988 - Modifiers:
public - Return:
ItemEnchantments
คืออะไร
อ่านค่า Enchantments
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getEntityRepresentation()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1007 - Modifiers:
public - Return:
Entity
คืออะไร
อ่านค่า Entity Representation
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: !this.isEmpty() ? this.entityRepresentation : null.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getFrame()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1002 - Modifiers:
public - Return:
ItemFrame
คืออะไร
อ่านค่า Frame
ทำงานยังไง
เรียกต่อ: getEntityRepresentation(). คืนค่า: this.entityRepresentation instanceof ItemFrame ? (ItemFrame)this.getEntityRepresentation() : null.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getHoverName()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:767 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Hover Name
ทำงานยังไง
เรียกต่อ: getCustomName(), getItemName(). คืนค่า: component != null ? component : this.getItemName().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getItem()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:327 - Modifiers:
public - Return:
Item
คืออะไร
อ่านค่า Item
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: this.isEmpty() ? Items.AIR : this.item.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getItemHolder()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:331 - Modifiers:
public - Return:
Holder<Item>
คืออะไร
อ่านค่า Item Holder
ทำงานยังไง
เรียกต่อ: getItem(), builtInRegistryHolder(). คืนค่า: this.getItem().builtInRegistryHolder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getItemName()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:790 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Item Name
ทำงานยังไง
เรียกต่อ: getItem(), getName(). คืนค่า: this.getItem().getName(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getMaxDamage()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:458 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Max Damage
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.getOrDefault(DataComponents.MAX_DAMAGE, 0).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getMaxStackSize()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:434 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Max Stack Size
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.getOrDefault(DataComponents.MAX_STACK_SIZE, 1).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getPopTime()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1049 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Pop Time
ทำงานยังไง
คืนค่า: this.popTime.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getPrototype()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:227 - Modifiers:
public - Return:
DataComponentMap
คืออะไร
อ่านค่า Prototype
ทำงานยังไง
เรียกต่อ: isEmpty(), getItem(), components(). คืนค่า: !this.isEmpty() ? this.getItem().components() : DataComponentMap.EMPTY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getRarity()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:958 - Modifiers:
public - Return:
Rarity
คืออะไร
อ่านค่า Rarity
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: getOrDefault(), isEnchanted(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getStyledHoverName()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:794 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Styled Hover Name
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: empty(), append(), getHoverName(), withStyle(), getRarity(), color(), has(). คืนค่า: mutableComponent.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getTags()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:355 - Modifiers:
public - Return:
Stream<TagKey<Item>>
คืออะไร
อ่านค่า Tags
ทำงานยังไง
เรียกต่อ: getItem(), builtInRegistryHolder(), tags(). คืนค่า: this.getItem().builtInRegistryHolder().tags().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getTooltipImage()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:218 - Modifiers:
public - Return:
Optional<TooltipComponent>
คืออะไร
อ่านค่า Tooltip Image
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getTooltipImage(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getTooltipLines(Item.TooltipContext,Player,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:812 - Modifiers:
public - Return:
List<Component>
คืออะไร
อ่านค่า Tooltip Lines
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), shouldPrintOpWarning(), isCreative(), has(), of(), newArrayList(), add(), getStyledHoverName(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Item.TooltipContext tooltipContextPlayer playerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
ItemStack instance = ...;
Item.TooltipContext tooltipContext = ...;
Player player = ...;
TooltipFlag tooltipFlag = ...;
List<Component> result = instance.getTooltipLines(tooltipContext, player, tooltipFlag);
net.minecraft.world.item.ItemStack#getUseAnimation()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:706 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getUseAnimation(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#getUseDuration(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:702 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().getUseDuration(this, livingEntity).
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack instance = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(livingEntity);
net.minecraft.world.item.ItemStack#grow(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1071 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ grow ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: setCount(), getCount().
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#hasFoil()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:953 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Foil
ทำงานยังไง
เรียกต่อ: get(), getItem(), isFoil(). คืนค่า: boolean_ != null ? boolean_ : this.getItem().isFoil(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#hashItemAndComponents(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:658 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ hashItemAndComponents ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), hashCode(), getComponents(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#hashStackList(List<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:667 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ hashStackList ตาม implementation ของ ItemStack
ทำงานยังไง
มีการวนลูป. เรียกต่อ: hashItemAndComponents(). คืนค่า: i.
Parameters
List<ItemStack> list
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#hasNonDefault(DataComponentType<?>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:239 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Non Default
ทำงานยังไง
เรียกต่อ: isEmpty(). คืนค่า: !this.isEmpty() && this.components.hasNonDefault(dataComponentType).
Parameters
DataComponentType<?> dataComponentType
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentType<?> dataComponentType = ...;
boolean result = instance.hasNonDefault(dataComponentType);
net.minecraft.world.item.ItemStack#hurtAndBreak(int,LivingEntity,EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:512 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผลความเสียหาย And Break
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: level(), onEquippedItemBroken().
Parameters
int iLivingEntity livingEntityEquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
ItemStack instance = ...;
LivingEntity livingEntity = ...;
EquipmentSlot equipmentSlot = ...;
instance.hurtAndBreak(0, livingEntity, equipmentSlot);
net.minecraft.world.item.ItemStack#hurtAndBreak(int,ServerLevel,ServerPlayer,Consumer<Item>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:470 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผลความเสียหาย And Break
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: processDurabilityChange(), applyDamage(), getDamageValue().
Parameters
int iServerLevel serverLevelServerPlayer serverPlayerConsumer<Item> consumer
ตัวอย่างใช้งาน
ItemStack instance = ...;
ServerLevel serverLevel = ...;
ServerPlayer serverPlayer = ...;
Consumer<Item> consumer = ...;
instance.hurtAndBreak(0, serverLevel, serverPlayer, consumer);
net.minecraft.world.item.ItemStack#hurtAndConvertOnBreak(int,ItemLike,LivingEntity,EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:520 - Modifiers:
public - Return:
ItemStack
คืออะไร
ประมวลผลความเสียหาย And Convert On Break
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: hurtAndBreak(), isEmpty(), transmuteCopyIgnoreEmpty(), isDamageableItem(), setDamageValue(). มีจุด return อย่างน้อย 2 จุด.
Parameters
int iItemLike itemLikeLivingEntity livingEntityEquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
ItemStack instance = ...;
ItemLike itemLike = ...;
LivingEntity livingEntity = ...;
EquipmentSlot equipmentSlot = ...;
ItemStack result = instance.hurtAndConvertOnBreak(0, itemLike, livingEntity, equipmentSlot);
net.minecraft.world.item.ItemStack#hurtEnemy(LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:554 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), awardStat(), get(). มีจุด return อย่างน้อย 2 จุด.
Parameters
LivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
ItemStack instance = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(livingEntity, livingEntity2);
net.minecraft.world.item.ItemStack#hurtWithoutBreaking(int,Player)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:500 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผลความเสียหาย Without Breaking
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: processDurabilityChange(), serverLevel(), min(), getDamageValue(), getMaxDamage(), applyDamage().
Parameters
int iPlayer player
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#immutableComponents()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:235 - Modifiers:
public - Return:
DataComponentMap
คืออะไร
ดำเนินการ immutableComponents ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: isEmpty(), toImmutableMap(). คืนค่า: !this.isEmpty() ? this.components.toImmutableMap() : DataComponentMap.EMPTY.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#interactLivingEntity(Player,LivingEntity,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:582 - Modifiers:
public - Return:
InteractionResult
คืออะไร
จัดการ interaction Living Entity
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().interactLivingEntity(this, player, livingEntity, interactionHand).
Parameters
Player playerLivingEntity livingEntityInteractionHand interactionHand
ตัวอย่างใช้งาน
ItemStack instance = ...;
Player player = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.interactLivingEntity(player, livingEntity, interactionHand);
net.minecraft.world.item.ItemStack#inventoryTick(Level,Entity,int,boolean)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:683 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ inventoryTick ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: popTime. เรียกต่อ: getItem().
Parameters
Level levelEntity entityint iboolean bl
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
Entity entity = ...;
instance.inventoryTick(level, entity, 0, true);
net.minecraft.world.item.ItemStack#is(Holder<Item>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:347 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ is
ทำงานยังไง
เรียกต่อ: getItem(), builtInRegistryHolder(). คืนค่า: this.getItem().builtInRegistryHolder() == holder.
Parameters
Holder<Item> holder
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#is(HolderSet<Item>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:351 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ is
ทำงานยังไง
เรียกต่อ: contains(), getItemHolder(). คืนค่า: holderSet.contains(this.getItemHolder()).
Parameters
HolderSet<Item> holderSet
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#is(Item)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:339 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ is
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem() == item.
Parameters
Item item
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#is(Predicate<Holder<Item>>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:343 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ is
ทำงานยังไง
เรียกต่อ: test(), getItem(), builtInRegistryHolder(). คืนค่า: predicate.test(this.getItem().builtInRegistryHolder()).
Parameters
Predicate<Holder<Item>> predicate
ตัวอย่างใช้งาน
ItemStack instance = ...;
Predicate<Holder<Item>> predicate = ...;
boolean result = instance.is(predicate);
net.minecraft.world.item.ItemStack#is(TagKey<Item>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:335 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ is
ทำงานยังไง
เรียกต่อ: getItem(), builtInRegistryHolder(). คืนค่า: this.getItem().builtInRegistryHolder().is(tagKey).
Parameters
TagKey<Item> tagKey
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isBarVisible()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:534 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Bar Visible
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().isBarVisible(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isBroken()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:462 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Broken
ทำงานยังไง
เรียกต่อ: isDamageableItem(), getDamageValue(), getMaxDamage(). คืนค่า: this.isDamageableItem() && this.getDamageValue() >= this.getMaxDamage().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isCorrectToolForDrops(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:578 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Correct Tool For Drops
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().isCorrectToolForDrops(this, blockState).
Parameters
BlockState blockState
ตัวอย่างใช้งาน
ItemStack instance = ...;
BlockState blockState = ...;
boolean result = instance.isCorrectToolForDrops(blockState);
net.minecraft.world.item.ItemStack#isDamageableItem()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:442 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Damageable Item
ทำงานยังไง
เรียกต่อ: has(). คืนค่า: this.has(DataComponents.MAX_DAMAGE) && !this.has(DataComponents.UNBREAKABLE) && this.has(DataComponents.DAMAGE).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isDamaged()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:446 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Damaged
ทำงานยังไง
เรียกต่อ: isDamageableItem(), getDamageValue(). คืนค่า: this.isDamageableItem() && this.getDamageValue() > 0.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:302 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
แก้ state: item. คืนค่า: this == EMPTY || this.item == Items.AIR || this.count <= 0.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isEnchantable()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:971 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Enchantable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: has(), get(), isEmpty(). มีจุด return อย่างน้อย 2 จุด.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isEnchanted()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:984 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Enchanted
ทำงานยังไง
เรียกต่อ: getOrDefault(), isEmpty(). คืนค่า: !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isFramed()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:992 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Framed
ทำงานยังไง
คืนค่า: this.entityRepresentation instanceof ItemFrame.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isItemEnabled(FeatureFlagSet)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:306 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Item Enabled
ทำงานยังไง
เรียกต่อ: isEmpty(), getItem(), isEnabled(). คืนค่า: this.isEmpty() || this.getItem().isEnabled(featureFlagSet).
Parameters
FeatureFlagSet featureFlagSet
ตัวอย่างใช้งาน
ItemStack instance = ...;
FeatureFlagSet featureFlagSet = ...;
boolean result = instance.isItemEnabled(featureFlagSet);
net.minecraft.world.item.ItemStack#isSameItem(ItemStack,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:641 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Same Item
ทำงานยังไง
เรียกต่อ: is(), getItem(). คืนค่า: itemStack.is(itemStack2.getItem()).
Parameters
ItemStack itemStackItemStack itemStack2
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
boolean result = ItemStack.isSameItem(itemStack, itemStack2);
net.minecraft.world.item.ItemStack#isSameItemSameComponents(ItemStack,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:645 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Same Item Same Components
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: is(), getItem(), isEmpty(), equals(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackItemStack itemStack2
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
boolean result = ItemStack.isSameItemSameComponents(itemStack, itemStack2);
net.minecraft.world.item.ItemStack#isStackable()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:438 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Stackable
ทำงานยังไง
เรียกต่อ: getMaxStackSize(), isDamageableItem(), isDamaged(). คืนค่า: this.getMaxStackSize() > 1 && (!this.isDamageableItem() || !this.isDamaged()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#isValidRepairItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1113 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Valid Repair Item
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: repairable != null && repairable.isValidRepairItem(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemStack instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isValidRepairItem(itemStack);
net.minecraft.world.item.ItemStack#ItemStack(Holder<Item>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:247 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemStack ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: value().
Parameters
Holder<Item> holder
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#ItemStack(Holder<Item>,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:255 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemStack ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: value().
Parameters
Holder<Item> holderint i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#ItemStack(Holder<Item>,int,DataComponentPatch)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:251 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemStack ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: value(), fromPatch(), components().
Parameters
Holder<Item> holderint iDataComponentPatch dataComponentPatch
ตัวอย่างใช้งาน
Holder<Item> holder = ...;
DataComponentPatch dataComponentPatch = ...;
ItemStack instance = new ItemStack(holder, 0, dataComponentPatch);
net.minecraft.world.item.ItemStack#ItemStack(ItemLike)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:243 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemStack ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ItemLike itemLike
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#ItemStack(ItemLike,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:259 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemStack ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: asItem(), components(). สร้างออบเจ็กต์: PatchedDataComponentMap.
Parameters
ItemLike itemLikeint i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#lenientOptionalFieldOf(String)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:653 - Modifiers:
public static - Return:
MapCodec<ItemStack>
คืออะไร
ดำเนินการ lenientOptionalFieldOf ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: xmap(), orElse(), isEmpty(), empty(), of(). คืนค่า: CODEC.lenientOptionalFieldOf(string) .xmap(optional -> optional.orElse(EMPTY), itemStack -> itemStack.isEmpty() ? Optional.empty() : Optional.of(itemStack)).
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#limitSize(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1065 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ limitSize ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), getCount(), setCount().
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#listMatches(List<ItemStack>,List<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:626 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ listMatches ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: size(), matches(), get(). มีจุด return อย่างน้อย 3 จุด.
Parameters
List<ItemStack> listList<ItemStack> list2
ตัวอย่างใช้งาน
List<ItemStack> list = ...;
List<ItemStack> list2 = ...;
boolean result = ItemStack.listMatches(list, list2);
net.minecraft.world.item.ItemStack#matches(ItemStack,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:618 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ matches ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCount(), isSameItemSameComponents(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackItemStack itemStack2
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
boolean result = ItemStack.matches(itemStack, itemStack2);
net.minecraft.world.item.ItemStack#mineBlock(Level,BlockState,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:571 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ mineBlock ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), awardStat(), get().
Parameters
Level levelBlockState blockStateBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
Player player = ...;
instance.mineBlock(level, blockState, blockPos, player);
net.minecraft.world.item.ItemStack#nextDamageWillBreak()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:466 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ nextDamageWillBreak ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: isDamageableItem(), getDamageValue(), getMaxDamage(). คืนค่า: this.isDamageableItem() && this.getDamageValue() >= this.getMaxDamage() - 1.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#onCraftedBy(Level,Player,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:693 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Crafted By
ทำงานยังไง
เรียกต่อ: awardStat(), get(), getItem().
Parameters
Level levelPlayer playerint i
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
Player player = ...;
instance.onCraftedBy(level, player, 0);
net.minecraft.world.item.ItemStack#onCraftedBySystem(Level)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:698 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Crafted By System
ทำงานยังไง
เรียกต่อ: getItem(), onCraftedPostProcess().
Parameters
Level level
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#onDestroyed(ItemEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1100 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Destroyed
ทำงานยังไง
เรียกต่อ: getItem().
Parameters
ItemEntity itemEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#onUseTick(Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1091 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Use Tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), shouldEmitParticlesAndSounds(), emitParticlesAndSounds(), getRandom(), getItem().
Parameters
Level levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
instance.onUseTick(level, livingEntity, 0);
net.minecraft.world.item.ItemStack#overrideOtherStackedOnMe(ItemStack,Slot,ClickAction,Player,SlotAccess)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:550 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideOtherStackedOnMe ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().overrideOtherStackedOnMe(this, itemStack, slot, clickAction, player, slotAccess).
Parameters
ItemStack itemStackSlot slotClickAction clickActionPlayer playerSlotAccess slotAccess
ตัวอย่างใช้งาน
ItemStack instance = ...;
ItemStack itemStack = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
SlotAccess slotAccess = ...;
boolean result = instance.overrideOtherStackedOnMe(itemStack, slot, clickAction, player, slotAccess);
net.minecraft.world.item.ItemStack#overrideStackedOnOther(Slot,ClickAction,Player)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:546 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ overrideStackedOnOther ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().overrideStackedOnOther(this, slot, clickAction, player).
Parameters
Slot slotClickAction clickActionPlayer player
ตัวอย่างใช้งาน
ItemStack instance = ...;
Slot slot = ...;
ClickAction clickAction = ...;
Player player = ...;
boolean result = instance.overrideStackedOnOther(slot, clickAction, player);
net.minecraft.world.item.ItemStack#parse(HolderLookup.Provider,Tag)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:293 - Modifiers:
public static - Return:
Optional<ItemStack>
คืออะไร
แปลง/วิเคราะห์ข้อมูล parse
ทำงานยังไง
เรียกต่อ: createSerializationContext(), resultOrPartial(), error(). คืนค่า: CODEC.parse(provider.createSerializationContext(NbtOps.INSTANCE), tag) .resultOrPartial(string -> LOGGER.error("Tried to load invalid item: '{}'", string)).
Parameters
HolderLookup.Provider providerTag tag
ตัวอย่างใช้งาน
HolderLookup.Provider provider = ...;
Tag tag = ...;
Optional<ItemStack> result = ItemStack.parse(provider, tag);
net.minecraft.world.item.ItemStack#parseOptional(HolderLookup.Provider,CompoundTag)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:298 - Modifiers:
public static - Return:
ItemStack
คืออะไร
แปลง/วิเคราะห์ข้อมูล Optional
ทำงานยังไง
เรียกต่อ: isEmpty(), parse(), orElse(). คืนค่า: compoundTag.isEmpty() ? EMPTY : parse(provider, compoundTag).orElse(EMPTY).
Parameters
HolderLookup.Provider providerCompoundTag compoundTag
ตัวอย่างใช้งาน
HolderLookup.Provider provider = ...;
CompoundTag compoundTag = ...;
ItemStack result = ItemStack.parseOptional(provider, compoundTag);
net.minecraft.world.item.ItemStack#postHurtEnemy(LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:567 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getItem().
Parameters
LivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
ItemStack instance = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(livingEntity, livingEntity2);
net.minecraft.world.item.ItemStack#releaseUsing(Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:710 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: copy(), getItem(), applyAfterUseComponentSideEffects(), setItemInHand(), getUsedItemHand().
Parameters
Level levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
LivingEntity livingEntity = ...;
instance.releaseUsing(level, livingEntity, 0);
net.minecraft.world.item.ItemStack#remove(DataComponentType<? extends T>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:740 - Modifiers:
public - Return:
T
คืออะไร
ลบ remove
ทำงานยังไง
คืนค่า: this.components.remove(dataComponentType).
Parameters
DataComponentType<? extends T> dataComponentType
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentType<? extends T> dataComponentType = ...;
T result = instance.remove(dataComponentType);
net.minecraft.world.item.ItemStack#save(HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:422 - Modifiers:
public - Return:
Tag
คืออะไร
บันทึก save
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), encodeStart(), createSerializationContext(), getOrThrow(). สร้างออบเจ็กต์: IllegalStateException. คืนค่า: CODEC.encodeStart(provider.createSerializationContext(NbtOps.INSTANCE), this).getOrThrow().
Parameters
HolderLookup.Provider provider
ตัวอย่างใช้งาน
ItemStack instance = ...;
HolderLookup.Provider provider = ...;
Tag result = instance.save(provider);
net.minecraft.world.item.ItemStack#save(HolderLookup.Provider,Tag)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:414 - Modifiers:
public - Return:
Tag
คืออะไร
บันทึก save
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), encode(), createSerializationContext(), getOrThrow(). สร้างออบเจ็กต์: IllegalStateException. คืนค่า: CODEC.encode(this, provider.createSerializationContext(NbtOps.INSTANCE), tag).getOrThrow().
Parameters
HolderLookup.Provider providerTag tag
ตัวอย่างใช้งาน
ItemStack instance = ...;
HolderLookup.Provider provider = ...;
Tag tag = ...;
Tag result = instance.save(provider, tag);
net.minecraft.world.item.ItemStack#saveOptional(HolderLookup.Provider)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:430 - Modifiers:
public - Return:
Tag
คืออะไร
บันทึก Optional
ทำงานยังไง
เรียกต่อ: isEmpty(), save(). สร้างออบเจ็กต์: CompoundTag. คืนค่า: this.isEmpty() ? new CompoundTag() : this.save(provider, new CompoundTag()).
Parameters
HolderLookup.Provider provider
ตัวอย่างใช้งาน
ItemStack instance = ...;
HolderLookup.Provider provider = ...;
Tag result = instance.saveOptional(provider);
net.minecraft.world.item.ItemStack#set(DataComponentType<? super T>,T)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:724 - Modifiers:
public - Return:
T
คืออะไร
กำหนดค่า set
ทำงานยังไง
คืนค่า: this.components.set(dataComponentType, object).
Parameters
DataComponentType<? super T> dataComponentTypeT object
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentType<? super T> dataComponentType = ...;
T object = ...;
T result = instance.set(dataComponentType, object);
net.minecraft.world.item.ItemStack#setCount(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1061 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Count
ทำงานยังไง
แก้ state: count.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#setDamageValue(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:454 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Damage Value
ทำงานยังไง
เรียกต่อ: set(), clamp(), getMaxDamage().
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#setEntityRepresentation(Entity)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:996 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Entity Representation
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: entityRepresentation. เรียกต่อ: isEmpty().
Parameters
Entity entity
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#setPopTime(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1053 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Pop Time
ทำงานยังไง
แก้ state: popTime.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#shrink(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:1075 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ shrink ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: grow().
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#split(int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:310 - Modifiers:
public - Return:
ItemStack
คืออะไร
แยก split
ทำงานยังไง
เรียกต่อ: min(), getCount(), copyWithCount(), shrink(). คืนค่า: itemStack.
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#toString()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:678 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getCount(), getItem(). คืนค่า: this.getCount() + " " + this.getItem().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#transmuteCopy(ItemLike)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:606 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ transmuteCopy ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: getCount(). คืนค่า: this.transmuteCopy(itemLike, this.getCount()).
Parameters
ItemLike itemLike
ตัวอย่างใช้งาน
ItemStack instance = ...;
ItemLike itemLike = ...;
ItemStack result = instance.transmuteCopy(itemLike);
net.minecraft.world.item.ItemStack#transmuteCopy(ItemLike,int)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:610 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ transmuteCopy ตาม implementation ของ ItemStack
ทำงานยังไง
เรียกต่อ: isEmpty(), transmuteCopyIgnoreEmpty(). คืนค่า: this.isEmpty() ? EMPTY : this.transmuteCopyIgnoreEmpty(itemLike, i).
Parameters
ItemLike itemLikeint i
ตัวอย่างใช้งาน
ItemStack instance = ...;
ItemLike itemLike = ...;
ItemStack result = instance.transmuteCopy(itemLike, 0);
net.minecraft.world.item.ItemStack#update(DataComponentType<T>,T,U,BiFunction<T, U, T>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:729 - Modifiers:
public - Return:
T
คืออะไร
อัปเดต update
ทำงานยังไง
เรียกต่อ: set(), apply(), getOrDefault(). คืนค่า: this.set(dataComponentType, biFunction.apply(this.getOrDefault(dataComponentType, object), object2)).
Parameters
DataComponentType<T> dataComponentTypeT objectU object2BiFunction<T, U, T> biFunction
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentType<T> dataComponentType = ...;
T object = ...;
U object2 = ...;
BiFunction<T, U, T> biFunction = ...;
T result = instance.update(dataComponentType, object, object2, biFunction);
net.minecraft.world.item.ItemStack#update(DataComponentType<T>,T,UnaryOperator<T>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:734 - Modifiers:
public - Return:
T
คืออะไร
อัปเดต update
ทำงานยังไง
เรียกต่อ: getOrDefault(), set(), apply(). คืนค่า: this.set(dataComponentType, unaryOperator.apply(object2)).
Parameters
DataComponentType<T> dataComponentTypeT objectUnaryOperator<T> unaryOperator
ตัวอย่างใช้งาน
ItemStack instance = ...;
DataComponentType<T> dataComponentType = ...;
T object = ...;
UnaryOperator<T> unaryOperator = ...;
T result = instance.update(dataComponentType, object, unaryOperator);
net.minecraft.world.item.ItemStack#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:379 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: copy(), getUseDuration(), getItem(), heldItemTransformedTo(), applyAfterUseComponentSideEffects().
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
ItemStack instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.ItemStack#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:359 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPlayer(), getClickedPos(), getAbilities(), canPlaceOnBlockInAdventureMode(), getLevel(), getItem(), wasItemInteraction(), awardStat(). สร้างออบเจ็กต์: BlockInWorld. มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
ItemStack instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
net.minecraft.world.item.ItemStack#useOnRelease()
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:720 - Modifiers:
public - Return:
boolean
คืออะไร
ใช้งาน On Release
ทำงานยังไง
เรียกต่อ: getItem(). คืนค่า: this.getItem().useOnRelease(this).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemStack#validateComponents(DataComponentMap)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:275 - Modifiers:
public static - Return:
DataResult<Unit>
คืออะไร
ตรวจสอบความถูกต้อง Components
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: has(), getOrDefault(), error(), nonEmptyItems(), getCount(), getMaxStackSize(), success(). มีจุด return อย่างน้อย 3 จุด.
Parameters
DataComponentMap dataComponentMap
ตัวอย่างใช้งาน
DataComponentMap dataComponentMap = ...;
DataResult<Unit> result = ItemStack.validateComponents(dataComponentMap);
net.minecraft.world.item.ItemStack#validatedStreamCodec(StreamCodec<RegistryFriendlyByteBuf, ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/ItemStack.java:200 - Modifiers:
public static - Return:
StreamCodec<RegistryFriendlyByteBuf, ItemStack>
คืออะไร
ดำเนินการ validatedStreamCodec ตาม implementation ของ ItemStack
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: decode(), isEmpty(), registryAccess(), createSerializationContext(), encodeStart(), getOrThrow(), encode(). คืนค่า: itemStack.
Parameters
StreamCodec<RegistryFriendlyByteBuf, ItemStack> streamCodec
ตัวอย่างใช้งาน
StreamCodec<RegistryFriendlyByteBuf, ItemStack> streamCodec = ...;
StreamCodec<RegistryFriendlyByteBuf, ItemStack> result = ItemStack.validatedStreamCodec(streamCodec);
ItemStackLinkedSet
- Full name:
net.minecraft.world.item.ItemStackLinkedSet - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemStackLinkedSet.java - Type:
class - Modifiers:
public
net.minecraft.world.item.ItemStackLinkedSet#createTypeAndComponentsSet()
- Origin:
common - Source:
net/minecraft/world/item/ItemStackLinkedSet.java:20 - Modifiers:
public static - Return:
Set<ItemStack>
คืออะไร
สร้าง Type And Components Set
ทำงานยังไง
สร้างออบเจ็กต์: ObjectLinkedOpenCustomHashSet<>. คืนค่า: new ObjectLinkedOpenCustomHashSet<>(TYPE_AND_TAG).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemUseAnimation
- Full name:
net.minecraft.world.item.ItemUseAnimation - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemUseAnimation.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.ItemUseAnimation#getId()
- Origin:
common - Source:
net/minecraft/world/item/ItemUseAnimation.java:35 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Id
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ItemUseAnimation#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/ItemUseAnimation.java:39 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemUtils
- Full name:
net.minecraft.world.item.ItemUtils - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ItemUtils.java - Type:
class - Modifiers:
public
net.minecraft.world.item.ItemUtils#createFilledResult(ItemStack,Player,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ItemUtils.java:37 - Modifiers:
public static - Return:
ItemStack
คืออะไร
สร้าง Filled Result
ทำงานยังไง
คืนค่า: createFilledResult(itemStack, player, itemStack2, true).
Parameters
ItemStack itemStackPlayer playerItemStack itemStack2
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Player player = ...;
ItemStack itemStack2 = ...;
ItemStack result = ItemUtils.createFilledResult(itemStack, player, itemStack2);
net.minecraft.world.item.ItemUtils#createFilledResult(ItemStack,Player,ItemStack,boolean)
- Origin:
common - Source:
net/minecraft/world/item/ItemUtils.java:15 - Modifiers:
public static - Return:
ItemStack
คืออะไร
สร้าง Filled Result
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: hasInfiniteMaterials(), getInventory(), contains(), add(), consume(), isEmpty(), drop(). มีจุด return อย่างน้อย 3 จุด.
Parameters
ItemStack itemStackPlayer playerItemStack itemStack2boolean bl
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Player player = ...;
ItemStack itemStack2 = ...;
ItemStack result = ItemUtils.createFilledResult(itemStack, player, itemStack2, true);
net.minecraft.world.item.ItemUtils#onContainerDestroyed(ItemEntity,Iterable<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/ItemUtils.java:41 - Modifiers:
public static - Return:
void
คืออะไร
จัดการเหตุการณ์ Container Destroyed
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: level(), forEach(), addFreshEntity(), getX(), getY(), getZ(). สร้างออบเจ็กต์: ItemEntity.
Parameters
ItemEntity itemEntityIterable<ItemStack> iterable
ตัวอย่างใช้งาน
ItemEntity itemEntity = ...;
Iterable<ItemStack> iterable = ...;
ItemUtils.onContainerDestroyed(itemEntity, iterable);
net.minecraft.world.item.ItemUtils#startUsingInstantly(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ItemUtils.java:10 - Modifiers:
public static - Return:
InteractionResult
คืออะไร
เริ่ม Using Instantly
ทำงานยังไง
เรียกต่อ: startUsingItem(). คืนค่า: InteractionResult.CONSUME.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = ItemUtils.startUsingInstantly(level, player, interactionHand);
JukeboxPlayable
- Full name:
net.minecraft.world.item.JukeboxPlayable - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/JukeboxPlayable.java - Type:
record - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.JukeboxPlayable#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxPlayable.java:45 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: registries(), unwrap(), ifPresent(), value(), description(), copy(), mergeStyles(), withColor().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
JukeboxPlayable instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.JukeboxPlayable#tryInsertIntoJukebox(Level,BlockPos,ItemStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxPlayable.java:61 - Modifiers:
public static - Return:
InteractionResult
คืออะไร
ดำเนินการ tryInsertIntoJukebox ตาม implementation ของ JukeboxPlayable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), getBlockState(), is(), getValue(), consumeAndReturn(), getBlockEntity(), setTheItem(), gameEvent(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelBlockPos blockPosItemStack itemStackPlayer player
ตัวอย่างใช้งาน
Level level = ...;
BlockPos blockPos = ...;
ItemStack itemStack = ...;
Player player = ...;
InteractionResult result = JukeboxPlayable.tryInsertIntoJukebox(level, blockPos, itemStack, player);
net.minecraft.world.item.JukeboxPlayable#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxPlayable.java:57 - Modifiers:
public - Return:
JukeboxPlayable
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ JukeboxPlayable
ทำงานยังไง
สร้างออบเจ็กต์: JukeboxPlayable. คืนค่า: new JukeboxPlayable(this.song, bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
JukeboxSong
- Full name:
net.minecraft.world.item.JukeboxSong - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/JukeboxSong.java - Type:
record - Modifiers:
public
net.minecraft.world.item.JukeboxSong#fromStack(HolderLookup.Provider,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSong.java:53 - Modifiers:
public static - Return:
Optional<Holder<JukeboxSong>>
คืออะไร
ดำเนินการ fromStack ตาม implementation ของ JukeboxSong
ทำงานยังไง
เรียกต่อ: get(), song(), unwrap(), empty(). คืนค่า: jukeboxPlayable != null ? jukeboxPlayable.song().unwrap(provider) : Optional.empty().
Parameters
HolderLookup.Provider providerItemStack itemStack
ตัวอย่างใช้งาน
HolderLookup.Provider provider = ...;
ItemStack itemStack = ...;
Optional<Holder<JukeboxSong>> result = JukeboxSong.fromStack(provider, itemStack);
net.minecraft.world.item.JukeboxSong#hasFinished(long)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSong.java:49 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Finished
ทำงานยังไง
เรียกต่อ: lengthInTicks(). คืนค่า: l >= this.lengthInTicks() + 20.
Parameters
long l
ตัวอย่างใช้งาน
net.minecraft.world.item.JukeboxSong#lengthInTicks()
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSong.java:45 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ lengthInTicks ตาม implementation ของ JukeboxSong
ทำงานยังไง
เรียกต่อ: ceil(). คืนค่า: Mth.ceil(this.lengthInSeconds * 20.0F).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
JukeboxSongPlayer
- Full name:
net.minecraft.world.item.JukeboxSongPlayer - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/JukeboxSongPlayer.java - Type:
class - Modifiers:
public
net.minecraft.world.item.JukeboxSongPlayer#getSong()
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:31 - Modifiers:
public - Return:
JukeboxSong
คืออะไร
อ่านค่า Song
ทำงานยังไง
แก้ state: song. เรียกต่อ: value(). คืนค่า: this.song == null ? null : this.song.value().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.JukeboxSongPlayer#getTicksSinceSongStarted()
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:36 - Modifiers:
public - Return:
long
คืออะไร
อ่านค่า Ticks Since Song Started
ทำงานยังไง
คืนค่า: this.ticksSinceSongStarted.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.JukeboxSongPlayer#isPlaying()
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:27 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Playing
ทำงานยังไง
คืนค่า: this.song != null.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.JukeboxSongPlayer#JukeboxSongPlayer(JukeboxSongPlayer.OnSongChanged,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ JukeboxSongPlayer ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: onSongChanged, blockPos.
Parameters
JukeboxSongPlayer.OnSongChanged onSongChangedBlockPos blockPos
ตัวอย่างใช้งาน
JukeboxSongPlayer.OnSongChanged onSongChanged = ...;
BlockPos blockPos = ...;
JukeboxSongPlayer instance = new JukeboxSongPlayer(onSongChanged, blockPos);
net.minecraft.world.item.JukeboxSongPlayer#play(LevelAccessor,Holder<JukeboxSong>)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:47 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ play ตาม implementation ของ JukeboxSongPlayer
ทำงานยังไง
แก้ state: song, ticksSinceSongStarted. เรียกต่อ: registryAccess(), lookupOrThrow(), getId(), value(), levelEvent(), notifyChange().
Parameters
LevelAccessor levelAccessorHolder<JukeboxSong> holder
ตัวอย่างใช้งาน
JukeboxSongPlayer instance = ...;
LevelAccessor levelAccessor = ...;
Holder<JukeboxSong> holder = ...;
instance.play(levelAccessor, holder);
net.minecraft.world.item.JukeboxSongPlayer#setSongWithoutPlaying(Holder<JukeboxSong>,long)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:40 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า Song Without Playing
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: song, ticksSinceSongStarted. เรียกต่อ: value(), hasFinished().
Parameters
Holder<JukeboxSong> holderlong l
ตัวอย่างใช้งาน
JukeboxSongPlayer instance = ...;
Holder<JukeboxSong> holder = ...;
instance.setSongWithoutPlaying(holder, 0L);
net.minecraft.world.item.JukeboxSongPlayer#stop(LevelAccessor,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:55 - Modifiers:
public - Return:
void
คืออะไร
หยุด stop
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: song, ticksSinceSongStarted. เรียกต่อ: gameEvent(), of(), levelEvent(), notifyChange().
Parameters
LevelAccessor levelAccessorBlockState blockState
ตัวอย่างใช้งาน
JukeboxSongPlayer instance = ...;
LevelAccessor levelAccessor = ...;
BlockState blockState = ...;
instance.stop(levelAccessor, blockState);
net.minecraft.world.item.JukeboxSongPlayer#tick(LevelAccessor,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:65 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผล tick tick
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: ticksSinceSongStarted. เรียกต่อ: value(), hasFinished(), stop(), shouldEmitJukeboxPlayingEvent(), gameEvent(), of(), spawnMusicParticles().
Parameters
LevelAccessor levelAccessorBlockState blockState
ตัวอย่างใช้งาน
JukeboxSongPlayer instance = ...;
LevelAccessor levelAccessor = ...;
BlockState blockState = ...;
instance.tick(levelAccessor, blockState);
JukeboxSongPlayer$OnSongChanged
- Full name:
net.minecraft.world.item.JukeboxSongPlayer$OnSongChanged - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/JukeboxSongPlayer.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.JukeboxSongPlayer$OnSongChanged#notifyChange()
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongPlayer.java:94 - Modifiers: ``
- Return:
void
คืออะไร
ดำเนินการ notifyChange ตาม implementation ของ JukeboxSongPlayer$OnSongChanged
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
JukeboxSongs
- Full name:
net.minecraft.world.item.JukeboxSongs - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/JukeboxSongs.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.JukeboxSongs#bootstrap(BootstrapContext<JukeboxSong>)
- Origin:
common - Source:
net/minecraft/world/item/JukeboxSongs.java:46 - Modifiers:
static - Return:
void
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ JukeboxSongs
ทำงานยังไง
เรียกต่อ: register().
Parameters
BootstrapContext<JukeboxSong> bootstrapContext
ตัวอย่างใช้งาน
KnowledgeBookItem
- Full name:
net.minecraft.world.item.KnowledgeBookItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/KnowledgeBookItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.KnowledgeBookItem#KnowledgeBookItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/KnowledgeBookItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ KnowledgeBookItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.KnowledgeBookItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/KnowledgeBookItem.java:26 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getItemInHand(), getOrDefault(), of(), consume(), isEmpty(), getServer(), getRecipeManager(), size(). สร้างออบเจ็กต์: ArrayList<>. มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
KnowledgeBookItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
LeadItem
- Full name:
net.minecraft.world.item.LeadItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/LeadItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.LeadItem#bindPlayerMobs(Player,Level,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/LeadItem.java:38 - Modifiers:
public static - Return:
InteractionResult
คืออะไร
ผูก Player Mobs
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: leashableInArea(), getLeashHolder(), getOrCreateKnot(), playPlacementSound(), setLeashedTo(), isEmpty(), gameEvent(), of(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Player playerLevel levelBlockPos blockPos
ตัวอย่างใช้งาน
Player player = ...;
Level level = ...;
BlockPos blockPos = ...;
InteractionResult result = LeadItem.bindPlayerMobs(player, level, blockPos);
net.minecraft.world.item.LeadItem#LeadItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/LeadItem.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ LeadItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.LeadItem#leashableInArea(Level,BlockPos,Predicate<Leashable>)
- Origin:
common - Source:
net/minecraft/world/item/LeadItem.java:59 - Modifiers:
public static - Return:
List<Leashable>
คืออะไร
ดำเนินการ leashableInArea ตาม implementation ของ LeadItem
ทำงานยังไง
เรียกต่อ: getX(), getY(), getZ(), getEntitiesOfClass(), test(), stream(), map(), toList(). สร้างออบเจ็กต์: AABB.
Parameters
Level levelBlockPos blockPosPredicate<Leashable> predicate
ตัวอย่างใช้งาน
Level level = ...;
BlockPos blockPos = ...;
Predicate<Leashable> predicate = ...;
List<Leashable> result = LeadItem.leashableInArea(level, blockPos, predicate);
net.minecraft.world.item.LeadItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/LeadItem.java:23 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), is(), getPlayer(), bindPlayerMobs(). มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
LeadItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
LingeringPotionItem
- Full name:
net.minecraft.world.item.LingeringPotionItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/LingeringPotionItem.java - Type:
class - Modifiers:
public - Extends:
ThrowablePotionItem
net.minecraft.world.item.LingeringPotionItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/LingeringPotionItem.java:19 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ LingeringPotionItem
ทำงานยังไง
เรียกต่อ: getOrDefault(), addPotionTooltip(), tickRate().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
LingeringPotionItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.LingeringPotionItem#LingeringPotionItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/LingeringPotionItem.java:15 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ LingeringPotionItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
LingeringPotionItem instance = new LingeringPotionItem(properties);
net.minecraft.world.item.LingeringPotionItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/LingeringPotionItem.java:25 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(). คืนค่า: super.use(level, player, interactionHand).
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
LingeringPotionItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
MaceItem
- Full name:
net.minecraft.world.item.MaceItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/MaceItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.MaceItem#canAttackBlock(BlockState,Level,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:53 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack Block
ทำงานยังไง
เรียกต่อ: isCreative(). คืนค่า: !player.isCreative().
Parameters
BlockState blockStateLevel levelBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
MaceItem instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
boolean result = instance.canAttackBlock(blockState, level, blockPos, player);
net.minecraft.world.item.MaceItem#canSmashAttack(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:162 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Smash Attack
ทำงานยังไง
เรียกต่อ: isFallFlying(). คืนค่า: livingEntity.fallDistance > 1.5F && !livingEntity.isFallFlying().
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.MaceItem#createAttributes()
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:42 - Modifiers:
public static - Return:
ItemAttributeModifiers
คืออะไร
สร้าง Attributes
ทำงานยังไง
เรียกต่อ: builder(), add(), build(). สร้างออบเจ็กต์: AttributeModifier.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.MaceItem#createToolProperties()
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:49 - Modifiers:
public static - Return:
Tool
คืออะไร
สร้าง Tool Properties
ทำงานยังไง
เรียกต่อ: of(). สร้างออบเจ็กต์: Tool. คืนค่า: new Tool(List.of(), 1.0F, 2).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.MaceItem#getAttackDamageBonus(Entity,float,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:104 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Attack Damage Bonus
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getDirectEntity(), canSmashAttack(), level(), modifyFallBasedDamage(), getWeaponItem(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Entity entityfloat fDamageSource damageSource
ตัวอย่างใช้งาน
MaceItem instance = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = instance.getAttackDamageBonus(entity, 0.0F, damageSource);
net.minecraft.world.item.MaceItem#getDamageSource(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:166 - Modifiers:
public - Return:
DamageSource
คืออะไร
อ่านค่า Damage Source
ทำงานยังไง
เรียกต่อ: canSmashAttack(), damageSources(), mace(). คืนค่า: canSmashAttack(livingEntity) ? livingEntity.damageSources().mace(livingEntity) : super.getDamageSource(livingEntity).
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
MaceItem instance = ...;
LivingEntity livingEntity = ...;
DamageSource result = instance.getDamageSource(livingEntity);
net.minecraft.world.item.MaceItem#hurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:58 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: canSmashAttack(), level(), setDeltaMovement(), getDeltaMovement(), with(), calculateImpactPosition(), setIgnoreFallDamageFromCurrentImpulse(), send(). สร้างออบเจ็กต์: ClientboundSetEntityMotionPacket. คืนค่า: true.
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
MaceItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.MaceItem#MaceItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:38 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ MaceItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.MaceItem#postHurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/MaceItem.java:96 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ MaceItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: hurtAndBreak(), canSmashAttack(), resetFallDistance().
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
MaceItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(itemStack, livingEntity, livingEntity2);
MapItem
- Full name:
net.minecraft.world.item.MapItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/MapItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.MapItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:318 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ MapItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), mapData(), add(), translatable(), id(), withStyle(), isAdvanced(), getTooltipForId().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
MapItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.MapItem#create(Level,int,int,byte,boolean,boolean)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:45 - Modifiers:
public static - Return:
ItemStack
คืออะไร
สร้าง create
ทำงานยังไง
เรียกต่อ: createNewSavedData(), dimension(), set(). สร้างออบเจ็กต์: ItemStack. คืนค่า: itemStack.
Parameters
Level levelint iint jbyte bboolean blboolean bl2
ตัวอย่างใช้งาน
net.minecraft.world.item.MapItem#getSavedData(ItemStack,Level)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:57 - Modifiers:
public static - Return:
MapItemSavedData
คืออะไร
อ่านค่า Saved Data
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: getSavedData(mapId, level).
Parameters
ItemStack itemStackLevel level
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Level level = ...;
MapItemSavedData result = MapItem.getSavedData(itemStack, level);
net.minecraft.world.item.MapItem#getSavedData(MapId,Level)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:52 - Modifiers:
public static - Return:
MapItemSavedData
คืออะไร
อ่านค่า Saved Data
ทำงานยังไง
เรียกต่อ: getMapData(). คืนค่า: mapId == null ? null : level.getMapData(mapId).
Parameters
MapId mapIdLevel level
ตัวอย่างใช้งาน
net.minecraft.world.item.MapItem#getTooltipForId(MapId)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:343 - Modifiers:
public static - Return:
Component
คืออะไร
อ่านค่า Tooltip For Id
ทำงานยังไง
เรียกต่อ: translatable(), id(), withStyle(). คืนค่า: Component.translatable("filled_map.id", mapId.id()).withStyle(ChatFormatting.GRAY).
Parameters
MapId mapId
ตัวอย่างใช้งาน
net.minecraft.world.item.MapItem#inventoryTick(ItemStack,Level,Entity,int,boolean)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:269 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ inventoryTick ตาม implementation ของ MapItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getSavedData(), tickCarriedBy(), getOffhandItem(), update().
Parameters
ItemStack itemStackLevel levelEntity entityint iboolean bl
ตัวอย่างใช้งาน
MapItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
Entity entity = ...;
instance.inventoryTick(itemStack, level, entity, 0, true);
net.minecraft.world.item.MapItem#lockMap(Level,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:308 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ lockMap ตาม implementation ของ MapItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getSavedData(), getFreeMapId(), locked(), setMapData(), set().
Parameters
Level levelItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.MapItem#MapItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:41 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ MapItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.MapItem#onCraftedPostProcess(ItemStack,Level)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:285 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Crafted Post Process
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: remove(), lockMap(), scaleMap().
Parameters
ItemStack itemStackLevel level
ตัวอย่างใช้งาน
MapItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
instance.onCraftedPostProcess(itemStack, level);
net.minecraft.world.item.MapItem#renderBiomePreviewMap(ServerLevel,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:194 - Modifiers:
public static - Return:
void
คืออะไร
เรนเดอร์ Biome Preview Map
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch ; มีการวนลูป. เรียกต่อ: getSavedData(), dimension(), MutableBlockPos(), getBiome(), set(), is(), isBiomeWatery(), sin(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos.
Parameters
ServerLevel serverLevelItemStack itemStack
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MapItem.renderBiomePreviewMap(serverLevel, itemStack);
net.minecraft.world.item.MapItem#update(Level,Entity,MapItemSavedData)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:70 - Modifiers:
public - Return:
void
คืออะไร
อัปเดต update
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: dimension(), floor(), getX(), getZ(), dimensionType(), hasCeiling(), getHoldingPlayer(), MutableBlockPos(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos.
Parameters
Level levelEntity entityMapItemSavedData mapItemSavedData
ตัวอย่างใช้งาน
MapItem instance = ...;
Level level = ...;
Entity entity = ...;
MapItemSavedData mapItemSavedData = ...;
instance.update(level, entity, mapItemSavedData);
net.minecraft.world.item.MapItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/MapItem.java:347 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getBlockState(), getClickedPos(), is(), getSavedData(), getItemInHand(), toggleBanner(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
MapItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
MinecartItem
- Full name:
net.minecraft.world.item.MinecartItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/MinecartItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.MinecartItem#MinecartItem(EntityType<? extends AbstractMinecart>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/MinecartItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ MinecartItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: type.
Parameters
EntityType<? extends AbstractMinecart> entityTypeItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends AbstractMinecart> entityType = ...;
Item.Properties properties = ...;
MinecartItem instance = new MinecartItem(entityType, properties);
net.minecraft.world.item.MinecartItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/MinecartItem.java:27 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), is(), getItemInHand(), getBlock(), getValue(), getShapeProperty(). สร้างออบเจ็กต์: Vec3. มีจุด return อย่างน้อย 4 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
MinecartItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
MobBucketItem
- Full name:
net.minecraft.world.item.MobBucketItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/MobBucketItem.java - Type:
class - Modifiers:
public - Extends:
BucketItem
net.minecraft.world.item.MobBucketItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/MobBucketItem.java:65 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ MobBucketItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: type. เรียกต่อ: getOrDefault(), isEmpty(), read(), result(), isPresent(), get(), baseColor(), patternColor().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
MobBucketItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.MobBucketItem#checkExtraContent(Player,Level,ItemStack,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/MobBucketItem.java:38 - Modifiers:
public - Return:
void
คืออะไร
ตรวจสอบ Extra Content
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: spawn(), gameEvent().
Parameters
Player playerLevel levelItemStack itemStackBlockPos blockPos
ตัวอย่างใช้งาน
MobBucketItem instance = ...;
Player player = ...;
Level level = ...;
ItemStack itemStack = ...;
BlockPos blockPos = ...;
instance.checkExtraContent(player, level, itemStack, blockPos);
net.minecraft.world.item.MobBucketItem#MobBucketItem(EntityType<? extends Mob>,Fluid,SoundEvent,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/MobBucketItem.java:32 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ MobBucketItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: type, emptySound.
Parameters
EntityType<? extends Mob> entityTypeFluid fluidSoundEvent soundEventItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends Mob> entityType = ...;
Fluid fluid = ...;
SoundEvent soundEvent = ...;
Item.Properties properties = ...;
MobBucketItem instance = new MobBucketItem(entityType, fluid, soundEvent, properties);
net.minecraft.world.item.MobBucketItem#playEmptySound(Player,LevelAccessor,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/MobBucketItem.java:46 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ playEmptySound ตาม implementation ของ MobBucketItem
ทำงานยังไง
เรียกต่อ: playSound().
Parameters
Player playerLevelAccessor levelAccessorBlockPos blockPos
ตัวอย่างใช้งาน
Player player = ...;
LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
@Override
protected void playEmptySound(Player player, LevelAccessor levelAccessor, BlockPos blockPos) {
super.playEmptySound(player, levelAccessor, blockPos);
}
NameTagItem
- Full name:
net.minecraft.world.item.NameTagItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/NameTagItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.NameTagItem#interactLivingEntity(ItemStack,Player,LivingEntity,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/NameTagItem.java:16 - Modifiers:
public - Return:
InteractionResult
คืออะไร
จัดการ interaction Living Entity
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), getType(), canSerialize(), canBeNameTagged(), level(), isAlive(), setCustomName(), setPersistenceRequired(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackPlayer playerLivingEntity livingEntityInteractionHand interactionHand
ตัวอย่างใช้งาน
NameTagItem instance = ...;
ItemStack itemStack = ...;
Player player = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.interactLivingEntity(itemStack, player, livingEntity, interactionHand);
net.minecraft.world.item.NameTagItem#NameTagItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/NameTagItem.java:12 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ NameTagItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
PickaxeItem
- Full name:
net.minecraft.world.item.PickaxeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/PickaxeItem.java - Type:
class - Modifiers:
public - Extends:
DiggerItem
net.minecraft.world.item.PickaxeItem#PickaxeItem(ToolMaterial,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/PickaxeItem.java:6 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ PickaxeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ToolMaterial toolMaterialfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
Item.Properties properties = ...;
PickaxeItem instance = new PickaxeItem(toolMaterial, 0.0F, 0.0F, properties);
PlaceOnWaterBlockItem
- Full name:
net.minecraft.world.item.PlaceOnWaterBlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/PlaceOnWaterBlockItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.PlaceOnWaterBlockItem#PlaceOnWaterBlockItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/PlaceOnWaterBlockItem.java:13 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ PlaceOnWaterBlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
PlaceOnWaterBlockItem instance = new PlaceOnWaterBlockItem(block, properties);
net.minecraft.world.item.PlaceOnWaterBlockItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/PlaceOnWaterBlockItem.java:22 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: getPlayerPOVHitResult(), withPosition(), getBlockPos(), above(), useOn(). สร้างออบเจ็กต์: UseOnContext. คืนค่า: super.useOn(new UseOnContext(player, interactionHand, blockHitResult2)).
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
PlaceOnWaterBlockItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.PlaceOnWaterBlockItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/PlaceOnWaterBlockItem.java:17 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
คืนค่า: InteractionResult.PASS.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
PlaceOnWaterBlockItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
PlayerHeadItem
- Full name:
net.minecraft.world.item.PlayerHeadItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/PlayerHeadItem.java - Type:
class - Modifiers:
public - Extends:
StandingAndWallBlockItem
net.minecraft.world.item.PlayerHeadItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/PlayerHeadItem.java:15 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: get(), name(), isPresent(), translatable().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
PlayerHeadItem instance = ...;
ItemStack itemStack = ...;
Component result = instance.getName(itemStack);
net.minecraft.world.item.PlayerHeadItem#PlayerHeadItem(Block,Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/PlayerHeadItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ PlayerHeadItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockBlock block2Item.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Block block2 = ...;
Item.Properties properties = ...;
PlayerHeadItem instance = new PlayerHeadItem(block, block2, properties);
net.minecraft.world.item.PlayerHeadItem#verifyComponentsAfterLoad(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/PlayerHeadItem.java:23 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ verifyComponentsAfterLoad ตาม implementation ของ PlayerHeadItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), isResolved(), resolve(), thenAcceptAsync(), set().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
PlayerHeadItem instance = ...;
ItemStack itemStack = ...;
instance.verifyComponentsAfterLoad(itemStack);
PotionItem
- Full name:
net.minecraft.world.item.PotionItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/PotionItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.PotionItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/PotionItem.java:81 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ PotionItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), addPotionTooltip(), tickRate().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
PotionItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.PotionItem#getDefaultInstance()
- Origin:
common - Source:
net/minecraft/world/item/PotionItem.java:29 - Modifiers:
public - Return:
ItemStack
คืออะไร
อ่านค่า Default Instance
ทำงานยังไง
เรียกต่อ: set(). สร้างออบเจ็กต์: PotionContents. คืนค่า: itemStack.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.PotionItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/PotionItem.java:75 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: potionContents != null ? potionContents.getName(this.descriptionId + ".effect.") : super.getName(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
PotionItem instance = ...;
ItemStack itemStack = ...;
Component result = instance.getName(itemStack);
net.minecraft.world.item.PotionItem#PotionItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/PotionItem.java:25 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ PotionItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.PotionItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/PotionItem.java:36 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getLevel(), getClickedPos(), getPlayer(), getItemInHand(), getOrDefault(), getBlockState(), getClickedFace(), is(). สร้างออบเจ็กต์: ItemStack. มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
PotionItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
ProjectileItem
- Full name:
net.minecraft.world.item.ProjectileItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ProjectileItem.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.ProjectileItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileItem.java:13 - Modifiers: ``
- Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ ProjectileItem
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
ProjectileItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.ProjectileItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/ProjectileItem.java:15 - Modifiers:
default - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
คืนค่า: ProjectileItem.DispenseConfig.DEFAULT.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ProjectileItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.ProjectileItem#shoot(Projectile,double,double,double,float,float)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileItem.java:19 - Modifiers:
default - Return:
void
คืออะไร
ดำเนินการ shoot ตาม implementation ของ ProjectileItem
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Projectile projectiledouble ddouble edouble ffloat gfloat h
ตัวอย่างใช้งาน
ProjectileItem instance = ...;
Projectile projectile = ...;
instance.shoot(projectile, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
ProjectileWeaponItem
- Full name:
net.minecraft.world.item.ProjectileWeaponItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ProjectileWeaponItem.java - Type:
class - Modifiers:
public abstract - Extends:
Item
net.minecraft.world.item.ProjectileWeaponItem#createProjectile(Level,LivingEntity,ItemStack,ItemStack,boolean)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:87 - Modifiers:
protected - Return:
Projectile
คืออะไร
สร้าง Projectile
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItem(), createArrow(), setCritArrow(). คืนค่า: abstractArrow.
Parameters
Level levelLivingEntity livingEntityItemStack itemStackItemStack itemStack2boolean bl
ตัวอย่างใช้งาน
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
@Override
protected Projectile createProjectile(Level level, LivingEntity livingEntity, ItemStack itemStack, ItemStack itemStack2, boolean bl) {
return super.createProjectile(level, livingEntity, itemStack, itemStack2, bl);
}
net.minecraft.world.item.ProjectileWeaponItem#draw(ItemStack,ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:97 - Modifiers:
protected static - Return:
List<ItemStack>
คืออะไร
วาด draw
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: isEmpty(), of(), level(), processProjectileCount(), copy(), useAmmo(), add(). สร้างออบเจ็กต์: ArrayList<>. มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackItemStack itemStack2LivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
LivingEntity livingEntity = ...;
@Override
protected List<ItemStack> draw(ItemStack itemStack, ItemStack itemStack2, LivingEntity livingEntity) {
return super.draw(itemStack, itemStack2, livingEntity);
}
net.minecraft.world.item.ProjectileWeaponItem#getAllSupportedProjectiles()
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:31 - Modifiers:
public abstract - Return:
Predicate<ItemStack>
คืออะไร
อ่านค่า All Supported Projectiles
ทำงานยังไง
ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ProjectileWeaponItem instance = ...;
Predicate<ItemStack> result = instance.getAllSupportedProjectiles();
net.minecraft.world.item.ProjectileWeaponItem#getDefaultProjectileRange()
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:41 - Modifiers:
public abstract - Return:
int
คืออะไร
อ่านค่า Default Projectile Range
ทำงานยังไง
ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ProjectileWeaponItem#getDurabilityUse(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:79 - Modifiers:
protected - Return:
int
คืออะไร
อ่านค่า Durability Use
ทำงานยังไง
คืนค่า: 1.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
@Override
protected int getDurabilityUse(ItemStack itemStack) {
return super.getDurabilityUse(itemStack);
}
net.minecraft.world.item.ProjectileWeaponItem#getHeldProjectile(LivingEntity,Predicate<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:33 - Modifiers:
public static - Return:
ItemStack
คืออะไร
อ่านค่า Held Projectile
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: test(), getItemInHand(). มีจุด return อย่างน้อย 2 จุด.
Parameters
LivingEntity livingEntityPredicate<ItemStack> predicate
ตัวอย่างใช้งาน
LivingEntity livingEntity = ...;
Predicate<ItemStack> predicate = ...;
ItemStack result = ProjectileWeaponItem.getHeldProjectile(livingEntity, predicate);
net.minecraft.world.item.ProjectileWeaponItem#getSupportedHeldProjectiles()
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:27 - Modifiers:
public - Return:
Predicate<ItemStack>
คืออะไร
อ่านค่า Supported Held Projectiles
ทำงานยังไง
เรียกต่อ: getAllSupportedProjectiles(). คืนค่า: this.getAllSupportedProjectiles().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ProjectileWeaponItem instance = ...;
Predicate<ItemStack> result = instance.getSupportedHeldProjectiles();
net.minecraft.world.item.ProjectileWeaponItem#ProjectileWeaponItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:23 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ProjectileWeaponItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
ProjectileWeaponItem instance = new ProjectileWeaponItem(properties);
net.minecraft.world.item.ProjectileWeaponItem#shoot(ServerLevel,LivingEntity,InteractionHand,ItemStack,List<ItemStack>,float,float,boolean,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:43 - Modifiers:
protected - Return:
void
คืออะไร
ดำเนินการ shoot ตาม implementation ของ ProjectileWeaponItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: processProjectileSpread(), size(), get(), isEmpty(), spawnProjectile(), createProjectile(), shootProjectile(), hurtAndBreak().
Parameters
ServerLevel serverLevelLivingEntity livingEntityInteractionHand interactionHandItemStack itemStackList<ItemStack> listfloat ffloat gboolean blLivingEntity livingEntity2
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
ItemStack itemStack = ...;
List<ItemStack> list = ...;
LivingEntity livingEntity2 = ...;
@Override
protected void shoot(ServerLevel serverLevel, LivingEntity livingEntity, InteractionHand interactionHand, ItemStack itemStack, List<ItemStack> list, float f, float g, boolean bl, LivingEntity livingEntity2) {
super.shoot(serverLevel, livingEntity, interactionHand, itemStack, list, f, g, bl, livingEntity2);
}
net.minecraft.world.item.ProjectileWeaponItem#shootProjectile(LivingEntity,Projectile,int,float,float,float,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:83 - Modifiers:
protected abstract - Return:
void
คืออะไร
ดำเนินการ shootProjectile ตาม implementation ของ ProjectileWeaponItem
ทำงานยังไง
ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง
Parameters
LivingEntity livingEntityProjectile projectileint ifloat ffloat gfloat hLivingEntity livingEntity2
ตัวอย่างใช้งาน
LivingEntity livingEntity = ...;
Projectile projectile = ...;
LivingEntity livingEntity2 = ...;
@Override
protected void shootProjectile(LivingEntity livingEntity, Projectile projectile, int i, float f, float g, float h, LivingEntity livingEntity2) {
super.shootProjectile(livingEntity, projectile, i, f, g, h, livingEntity2);
}
net.minecraft.world.item.ProjectileWeaponItem#useAmmo(ItemStack,ItemStack,LivingEntity,boolean)
- Origin:
common - Source:
net/minecraft/world/item/ProjectileWeaponItem.java:116 - Modifiers:
protected static - Return:
ItemStack
คืออะไร
ใช้งาน Ammo
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: hasInfiniteMaterials(), level(), processAmmoUse(), getCount(), copyWithCount(), set(), split(), isEmpty(). มีจุด return อย่างน้อย 3 จุด.
Parameters
ItemStack itemStackItemStack itemStack2LivingEntity livingEntityboolean bl
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
LivingEntity livingEntity = ...;
@Override
protected ItemStack useAmmo(ItemStack itemStack, ItemStack itemStack2, LivingEntity livingEntity, boolean bl) {
return super.useAmmo(itemStack, itemStack2, livingEntity, bl);
}
Rarity
- Full name:
net.minecraft.world.item.Rarity - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/Rarity.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.Rarity#color()
- Origin:
common - Source:
net/minecraft/world/item/Rarity.java:31 - Modifiers:
public - Return:
ChatFormatting
คืออะไร
ดำเนินการ color ตาม implementation ของ Rarity
ทำงานยังไง
คืนค่า: this.color.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.Rarity#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/Rarity.java:35 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
SaddleItem
- Full name:
net.minecraft.world.item.SaddleItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SaddleItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.SaddleItem#interactLivingEntity(ItemStack,Player,LivingEntity,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/SaddleItem.java:16 - Modifiers:
public - Return:
InteractionResult
คืออะไร
จัดการ interaction Living Entity
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isAlive(), isSaddled(), isSaddleable(), level(), equipSaddle(), split(), gameEvent(), position(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackPlayer playerLivingEntity livingEntityInteractionHand interactionHand
ตัวอย่างใช้งาน
SaddleItem instance = ...;
ItemStack itemStack = ...;
Player player = ...;
LivingEntity livingEntity = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.interactLivingEntity(itemStack, player, livingEntity, interactionHand);
net.minecraft.world.item.SaddleItem#SaddleItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SaddleItem.java:12 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SaddleItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
ScaffoldingBlockItem
- Full name:
net.minecraft.world.item.ScaffoldingBlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ScaffoldingBlockItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.ScaffoldingBlockItem#mustSurvive()
- Origin:
common - Source:
net/minecraft/world/item/ScaffoldingBlockItem.java:69 - Modifiers:
protected - Return:
boolean
คืออะไร
ดำเนินการ mustSurvive ตาม implementation ของ ScaffoldingBlockItem
ทำงานยังไง
คืนค่า: false.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ScaffoldingBlockItem#ScaffoldingBlockItem(Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ScaffoldingBlockItem.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ScaffoldingBlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Item.Properties properties = ...;
ScaffoldingBlockItem instance = new ScaffoldingBlockItem(block, properties);
net.minecraft.world.item.ScaffoldingBlockItem#updatePlacementContext(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/ScaffoldingBlockItem.java:21 - Modifiers:
public - Return:
BlockPlaceContext
คืออะไร
อัปเดต Placement Context
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getClickedPos(), getLevel(), getBlockState(), getBlock(), is(), getDistance(), isSecondaryUseActive(), isInside(). มีจุด return อย่างน้อย 3 จุด.
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
ScaffoldingBlockItem instance = ...;
BlockPlaceContext blockPlaceContext = ...;
BlockPlaceContext result = instance.updatePlacementContext(blockPlaceContext);
ServerItemCooldowns
- Full name:
net.minecraft.world.item.ServerItemCooldowns - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ServerItemCooldowns.java - Type:
class - Modifiers:
public - Extends:
ItemCooldowns
net.minecraft.world.item.ServerItemCooldowns#onCooldownEnded(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/ServerItemCooldowns.java:20 - Modifiers:
protected - Return:
void
คืออะไร
จัดการเหตุการณ์ Cooldown Ended
ทำงานยังไง
เรียกต่อ: send(). สร้างออบเจ็กต์: ClientboundCooldownPacket.
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
ResourceLocation resourceLocation = ...;
@Override
protected void onCooldownEnded(ResourceLocation resourceLocation) {
super.onCooldownEnded(resourceLocation);
}
net.minecraft.world.item.ServerItemCooldowns#onCooldownStarted(ResourceLocation,int)
- Origin:
common - Source:
net/minecraft/world/item/ServerItemCooldowns.java:14 - Modifiers:
protected - Return:
void
คืออะไร
จัดการเหตุการณ์ Cooldown Started
ทำงานยังไง
เรียกต่อ: send(). สร้างออบเจ็กต์: ClientboundCooldownPacket.
Parameters
ResourceLocation resourceLocationint i
ตัวอย่างใช้งาน
ResourceLocation resourceLocation = ...;
@Override
protected void onCooldownStarted(ResourceLocation resourceLocation, int i) {
super.onCooldownStarted(resourceLocation, i);
}
net.minecraft.world.item.ServerItemCooldowns#ServerItemCooldowns(ServerPlayer)
- Origin:
common - Source:
net/minecraft/world/item/ServerItemCooldowns.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ServerItemCooldowns ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: player.
Parameters
ServerPlayer serverPlayer
ตัวอย่างใช้งาน
ServerPlayer serverPlayer = ...;
ServerItemCooldowns instance = new ServerItemCooldowns(serverPlayer);
ShearsItem
- Full name:
net.minecraft.world.item.ShearsItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ShearsItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.ShearsItem#createToolProperties()
- Origin:
common - Source:
net/minecraft/world/item/ShearsItem.java:31 - Modifiers:
public static - Return:
Tool
คืออะไร
สร้าง Tool Properties
ทำงานยังไง
เรียกต่อ: acquireBootstrapRegistrationLookup(), of(), minesAndDrops(), direct(), builtInRegistryHolder(), overrideSpeed(), getOrThrow(). สร้างออบเจ็กต์: Tool.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.ShearsItem#mineBlock(ItemStack,Level,BlockState,BlockPos,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ShearsItem.java:45 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ mineBlock ตาม implementation ของ ShearsItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: is(), hurtAndBreak().
Parameters
ItemStack itemStackLevel levelBlockState blockStateBlockPos blockPosLivingEntity livingEntity
ตัวอย่างใช้งาน
ShearsItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
LivingEntity livingEntity = ...;
boolean result = instance.mineBlock(itemStack, level, blockState, blockPos, livingEntity);
net.minecraft.world.item.ShearsItem#ShearsItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ShearsItem.java:27 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ShearsItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.ShearsItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/ShearsItem.java:62 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), getBlock(), isMaxAge(), getPlayer(), getItemInHand(), trigger(). มีจุด return อย่างน้อย 2 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
ShearsItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
ShieldItem
- Full name:
net.minecraft.world.item.ShieldItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ShieldItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.ShieldItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:26 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ ShieldItem
ทำงานยังไง
เรียกต่อ: appendHoverTextFromBannerBlockEntityTag().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
ShieldItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.ShieldItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:20 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: get(), translatable(). คืนค่า: dyeColor != null ? Component.translatable(this.descriptionId + "." + dyeColor.getName()) : super.getName(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ShieldItem instance = ...;
ItemStack itemStack = ...;
Component result = instance.getName(itemStack);
net.minecraft.world.item.ShieldItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:31 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.BLOCK.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ShieldItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.ShieldItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:36 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 72000.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
ShieldItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.ShieldItem#ShieldItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:16 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ShieldItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.ShieldItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ShieldItem.java:41 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: startUsingItem(). คืนค่า: InteractionResult.CONSUME.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
ShieldItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
ShovelItem
- Full name:
net.minecraft.world.item.ShovelItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ShovelItem.java - Type:
class - Modifiers:
public - Extends:
DiggerItem
net.minecraft.world.item.ShovelItem#ShovelItem(ToolMaterial,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ShovelItem.java:34 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ShovelItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ToolMaterial toolMaterialfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
Item.Properties properties = ...;
ShovelItem instance = new ShovelItem(toolMaterial, 0.0F, 0.0F, properties);
net.minecraft.world.item.ShovelItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/ShovelItem.java:38 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getClickedPos(), getBlockState(), getClickedFace(), getPlayer(), get(), getBlock(), above(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
ShovelItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
SignApplicator
- Full name:
net.minecraft.world.item.SignApplicator - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SignApplicator.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.SignApplicator#canApplyToSign(SignText,Player)
- Origin:
common - Source:
net/minecraft/world/item/SignApplicator.java:11 - Modifiers:
default - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Apply To Sign
ทำงานยังไง
เรียกต่อ: hasMessage(). คืนค่า: signText.hasMessage(player).
Parameters
SignText signTextPlayer player
ตัวอย่างใช้งาน
SignApplicator instance = ...;
SignText signText = ...;
Player player = ...;
boolean result = instance.canApplyToSign(signText, player);
net.minecraft.world.item.SignApplicator#tryApplyToSign(Level,SignBlockEntity,boolean,Player)
- Origin:
common - Source:
net/minecraft/world/item/SignApplicator.java:9 - Modifiers: ``
- Return:
boolean
คืออะไร
ดำเนินการ tryApplyToSign ตาม implementation ของ SignApplicator
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Level levelSignBlockEntity signBlockEntityboolean blPlayer player
ตัวอย่างใช้งาน
SignApplicator instance = ...;
Level level = ...;
SignBlockEntity signBlockEntity = ...;
Player player = ...;
boolean result = instance.tryApplyToSign(level, signBlockEntity, true, player);
SignItem
- Full name:
net.minecraft.world.item.SignItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SignItem.java - Type:
class - Modifiers:
public - Extends:
StandingAndWallBlockItem
net.minecraft.world.item.SignItem#SignItem(Block,Block,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SignItem.java:14 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SignItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Block blockBlock block2Item.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Block block2 = ...;
Item.Properties properties = ...;
SignItem instance = new SignItem(block, block2, properties);
net.minecraft.world.item.SignItem#SignItem(Item.Properties,Block,Block,Direction)
- Origin:
common - Source:
net/minecraft/world/item/SignItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SignItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties propertiesBlock blockBlock block2Direction direction
ตัวอย่างใช้งาน
Item.Properties properties = ...;
Block block = ...;
Block block2 = ...;
Direction direction = ...;
SignItem instance = new SignItem(properties, block, block2, direction);
net.minecraft.world.item.SignItem#updateCustomBlockEntityTag(BlockPos,Level,Player,ItemStack,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/SignItem.java:22 - Modifiers:
protected - Return:
boolean
คืออะไร
อัปเดต Custom Block Entity Tag
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlockEntity(), getBlockState(), getBlock(), openTextEdit(). คืนค่า: bl.
Parameters
BlockPos blockPosLevel levelPlayer playerItemStack itemStackBlockState blockState
ตัวอย่างใช้งาน
BlockPos blockPos = ...;
Level level = ...;
Player player = ...;
ItemStack itemStack = ...;
BlockState blockState = ...;
@Override
protected boolean updateCustomBlockEntityTag(BlockPos blockPos, Level level, Player player, ItemStack itemStack, BlockState blockState) {
return super.updateCustomBlockEntityTag(blockPos, level, player, itemStack, blockState);
}
SmithingTemplateItem
- Full name:
net.minecraft.world.item.SmithingTemplateItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SmithingTemplateItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.SmithingTemplateItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:146 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ SmithingTemplateItem
ทำงานยังไง
เรียกต่อ: add(), space(), append().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
SmithingTemplateItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.SmithingTemplateItem#createArmorTrimTemplate(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:94 - Modifiers:
public static - Return:
SmithingTemplateItem
คืออะไร
สร้าง Armor Trim Template
ทำงานยังไง
เรียกต่อ: createTrimmableArmorIconList(), createTrimmableMaterialIconList(). สร้างออบเจ็กต์: SmithingTemplateItem.
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
SmithingTemplateItem result = SmithingTemplateItem.createArmorTrimTemplate(properties);
net.minecraft.world.item.SmithingTemplateItem#createNetheriteUpgradeTemplate(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:106 - Modifiers:
public static - Return:
SmithingTemplateItem
คืออะไร
สร้าง Netherite Upgrade Template
ทำงานยังไง
เรียกต่อ: createNetheriteUpgradeIconList(), createNetheriteUpgradeMaterialList(). สร้างออบเจ็กต์: SmithingTemplateItem.
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
SmithingTemplateItem result = SmithingTemplateItem.createNetheriteUpgradeTemplate(properties);
net.minecraft.world.item.SmithingTemplateItem#getAdditionalSlotEmptyIcons()
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:169 - Modifiers:
public - Return:
List<ResourceLocation>
คืออะไร
อ่านค่า Additional Slot Empty Icons
ทำงานยังไง
คืนค่า: this.additionalSlotEmptyIcons.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
SmithingTemplateItem instance = ...;
List<ResourceLocation> result = instance.getAdditionalSlotEmptyIcons();
net.minecraft.world.item.SmithingTemplateItem#getAdditionSlotDescription()
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:161 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Addition Slot Description
ทำงานยังไง
คืนค่า: this.additionsSlotDescription.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.SmithingTemplateItem#getBaseSlotDescription()
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:157 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Base Slot Description
ทำงานยังไง
คืนค่า: this.baseSlotDescription.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.SmithingTemplateItem#getBaseSlotEmptyIcons()
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:165 - Modifiers:
public - Return:
List<ResourceLocation>
คืออะไร
อ่านค่า Base Slot Empty Icons
ทำงานยังไง
คืนค่า: this.baseSlotEmptyIcons.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
SmithingTemplateItem instance = ...;
List<ResourceLocation> result = instance.getBaseSlotEmptyIcons();
net.minecraft.world.item.SmithingTemplateItem#SmithingTemplateItem(Component,Component,Component,Component,List<ResourceLocation>,List<ResourceLocation>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SmithingTemplateItem.java:76 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SmithingTemplateItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: appliesTo, ingredients, baseSlotDescription, additionsSlotDescription, baseSlotEmptyIcons, additionalSlotEmptyIcons.
Parameters
Component componentComponent component2Component component3Component component4List<ResourceLocation> listList<ResourceLocation> list2Item.Properties properties
ตัวอย่างใช้งาน
Component component = ...;
Component component2 = ...;
Component component3 = ...;
Component component4 = ...;
List<ResourceLocation> list = ...;
List<ResourceLocation> list2 = ...;
Item.Properties properties = ...;
SmithingTemplateItem instance = new SmithingTemplateItem(component, component2, component3, component4, list, list2, properties);
SnowballItem
- Full name:
net.minecraft.world.item.SnowballItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SnowballItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.SnowballItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/SnowballItem.java:45 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ SnowballItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(). สร้างออบเจ็กต์: Snowball. คืนค่า: new Snowball(level, position.x(), position.y(), position.z(), itemStack).
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
SnowballItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.SnowballItem#SnowballItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SnowballItem.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SnowballItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.SnowballItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/SnowballItem.java:23 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(), spawnProjectileFromRotation(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
SnowballItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
SolidBucketItem
- Full name:
net.minecraft.world.item.SolidBucketItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SolidBucketItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem - Implements:
DispensibleContainerItem
net.minecraft.world.item.SolidBucketItem#emptyContents(Player,Level,BlockPos,BlockHitResult)
- Origin:
common - Source:
net/minecraft/world/item/SolidBucketItem.java:40 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ emptyContents ตาม implementation ของ SolidBucketItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: isInWorldBounds(), isEmptyBlock(), setBlock(), getBlock(), defaultBlockState(), gameEvent(), playSound(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Player playerLevel levelBlockPos blockPosBlockHitResult blockHitResult
ตัวอย่างใช้งาน
SolidBucketItem instance = ...;
Player player = ...;
Level level = ...;
BlockPos blockPos = ...;
BlockHitResult blockHitResult = ...;
boolean result = instance.emptyContents(player, level, blockPos, blockHitResult);
net.minecraft.world.item.SolidBucketItem#getPlaceSound(BlockState)
- Origin:
common - Source:
net/minecraft/world/item/SolidBucketItem.java:35 - Modifiers:
protected - Return:
SoundEvent
คืออะไร
อ่านค่า Place Sound
ทำงานยังไง
คืนค่า: this.placeSound.
Parameters
BlockState blockState
ตัวอย่างใช้งาน
BlockState blockState = ...;
@Override
protected SoundEvent getPlaceSound(BlockState blockState) {
return super.getPlaceSound(blockState);
}
net.minecraft.world.item.SolidBucketItem#SolidBucketItem(Block,SoundEvent,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SolidBucketItem.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SolidBucketItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: placeSound.
Parameters
Block blockSoundEvent soundEventItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
SoundEvent soundEvent = ...;
Item.Properties properties = ...;
SolidBucketItem instance = new SolidBucketItem(block, soundEvent, properties);
net.minecraft.world.item.SolidBucketItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/SolidBucketItem.java:24 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPlayer(), consumesAction(), setItemInHand(), getHand(), getEmptySuccessItem(), getItemInHand(). คืนค่า: interactionResult.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
SolidBucketItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
SpawnEggItem
- Full name:
net.minecraft.world.item.SpawnEggItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SpawnEggItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.SpawnEggItem#byId(EntityType<?>)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:130 - Modifiers:
public static - Return:
SpawnEggItem
คืออะไร
ดำเนินการ byId ตาม implementation ของ SpawnEggItem
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: BY_ID.get(entityType).
Parameters
EntityType<?> entityType
ตัวอย่างใช้งาน
net.minecraft.world.item.SpawnEggItem#eggs()
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:135 - Modifiers:
public static - Return:
Iterable<SpawnEggItem>
คืออะไร
ดำเนินการ eggs ตาม implementation ของ SpawnEggItem
ทำงานยังไง
เรียกต่อ: unmodifiableIterable(), values(). คืนค่า: Iterables.unmodifiableIterable(BY_ID.values()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.SpawnEggItem#getType(HolderLookup.Provider,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:139 - Modifiers:
public - Return:
EntityType<?>
คืออะไร
อ่านค่า Type
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getOrDefault(), isEmpty(), parseEntityType(). มีจุด return อย่างน้อย 2 จุด.
Parameters
HolderLookup.Provider providerItemStack itemStack
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
HolderLookup.Provider provider = ...;
ItemStack itemStack = ...;
EntityType<?> result = instance.getType(provider, itemStack);
net.minecraft.world.item.SpawnEggItem#requiredFeatures()
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:151 - Modifiers:
public - Return:
FeatureFlagSet
คืออะไร
ดำเนินการ requiredFeatures ตาม implementation ของ SpawnEggItem
ทำงานยังไง
คืนค่า: this.defaultType.requiredFeatures().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.SpawnEggItem#shouldPrintOpWarning(ItemStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:186 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าควร Print Op Warning
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPermissionLevel(), get(), parseEntityType(), level(), registryAccess(), onlyOpCanSetNbt(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackPlayer player
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
ItemStack itemStack = ...;
Player player = ...;
boolean result = instance.shouldPrintOpWarning(itemStack, player);
net.minecraft.world.item.SpawnEggItem#SpawnEggItem(EntityType<? extends Mob>,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:41 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SpawnEggItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: defaultType. เรียกต่อ: put().
Parameters
EntityType<? extends Mob> entityTypeItem.Properties properties
ตัวอย่างใช้งาน
EntityType<? extends Mob> entityType = ...;
Item.Properties properties = ...;
SpawnEggItem instance = new SpawnEggItem(entityType, properties);
net.minecraft.world.item.SpawnEggItem#spawnOffspringFromSpawnEgg(Player,Mob,EntityType<? extends Mob>,ServerLevel,Vec3,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:156 - Modifiers:
public - Return:
Optional<Mob>
คืออะไร
สร้าง entity ในโลก Offspring From Spawn Egg
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: spawnsEntity(), registryAccess(), empty(), getBreedOffspring(), create(), setBaby(), isBaby(), moveTo(). มีจุด return อย่างน้อย 4 จุด.
Parameters
Player playerMob mobEntityType<? extends Mob> entityTypeServerLevel serverLevelVec3 vec3ItemStack itemStack
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
Player player = ...;
Mob mob = ...;
EntityType<? extends Mob> entityType = ...;
ServerLevel serverLevel = ...;
Vec3 vec3 = ...;
ItemStack itemStack = ...;
Optional<Mob> result = instance.spawnOffspringFromSpawnEgg(player, mob, entityType, serverLevel, vec3, itemStack);
net.minecraft.world.item.SpawnEggItem#spawnsEntity(HolderLookup.Provider,ItemStack,EntityType<?>)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:126 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ spawnsEntity ตาม implementation ของ SpawnEggItem
ทำงานยังไง
เรียกต่อ: equals(), getType(). คืนค่า: Objects.equals(this.getType(provider, itemStack), entityType).
Parameters
HolderLookup.Provider providerItemStack itemStackEntityType<?> entityType
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
HolderLookup.Provider provider = ...;
ItemStack itemStack = ...;
EntityType<?> entityType = ...;
boolean result = instance.spawnsEntity(provider, itemStack, entityType);
net.minecraft.world.item.SpawnEggItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:92 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), getPlayerPOVHitResult(), getType(), getBlockPos(), getBlockState(), getBlock(), mayInteract(), mayUseItemAt(). มีจุด return อย่างน้อย 6 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.SpawnEggItem#useOn(UseOnContext)
- Origin:
common - Source:
net/minecraft/world/item/SpawnEggItem.java:47 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน On
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getLevel(), getItemInHand(), getClickedPos(), getClickedFace(), getBlockState(), getBlockEntity(), getType(), registryAccess(). มีจุด return อย่างน้อย 3 จุด.
Parameters
UseOnContext useOnContext
ตัวอย่างใช้งาน
SpawnEggItem instance = ...;
UseOnContext useOnContext = ...;
InteractionResult result = instance.useOn(useOnContext);
SpectralArrowItem
- Full name:
net.minecraft.world.item.SpectralArrowItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SpectralArrowItem.java - Type:
class - Modifiers:
public - Extends:
ArrowItem
net.minecraft.world.item.SpectralArrowItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/SpectralArrowItem.java:22 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ SpectralArrowItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(), copyWithCount(). สร้างออบเจ็กต์: SpectralArrow. คืนค่า: spectralArrow.
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
SpectralArrowItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.SpectralArrowItem#createArrow(Level,ItemStack,LivingEntity,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/SpectralArrowItem.java:17 - Modifiers:
public - Return:
AbstractArrow
คืออะไร
สร้าง Arrow
ทำงานยังไง
เรียกต่อ: copyWithCount(). สร้างออบเจ็กต์: SpectralArrow. คืนค่า: new SpectralArrow(level, livingEntity, itemStack.copyWithCount(1), itemStack2).
Parameters
Level levelItemStack itemStackLivingEntity livingEntityItemStack itemStack2
ตัวอย่างใช้งาน
SpectralArrowItem instance = ...;
Level level = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
ItemStack itemStack2 = ...;
AbstractArrow result = instance.createArrow(level, itemStack, livingEntity, itemStack2);
net.minecraft.world.item.SpectralArrowItem#SpectralArrowItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SpectralArrowItem.java:13 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SpectralArrowItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
SplashPotionItem
- Full name:
net.minecraft.world.item.SplashPotionItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SplashPotionItem.java - Type:
class - Modifiers:
public - Extends:
ThrowablePotionItem
net.minecraft.world.item.SplashPotionItem#SplashPotionItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SplashPotionItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SplashPotionItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.SplashPotionItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/SplashPotionItem.java:15 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: playSound(), getX(), getY(), getZ(), getRandom(), nextFloat(). คืนค่า: super.use(level, player, interactionHand).
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
SplashPotionItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
SpyglassItem
- Full name:
net.minecraft.world.item.SpyglassItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SpyglassItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.SpyglassItem#finishUsingItem(ItemStack,Level,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:36 - Modifiers:
public - Return:
ItemStack
คืออะไร
ดำเนินการ finishUsingItem ตาม implementation ของ SpyglassItem
ทำงานยังไง
เรียกต่อ: stopUsing(). คืนค่า: itemStack.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntity
ตัวอย่างใช้งาน
SpyglassItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
ItemStack result = instance.finishUsingItem(itemStack, level, livingEntity);
net.minecraft.world.item.SpyglassItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:24 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.SPYGLASS.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
SpyglassItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.SpyglassItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:19 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 1200.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
SpyglassItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.SpyglassItem#releaseUsing(ItemStack,Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:42 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ SpyglassItem
ทำงานยังไง
เรียกต่อ: stopUsing(). คืนค่า: true.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
SpyglassItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
boolean result = instance.releaseUsing(itemStack, level, livingEntity, 0);
net.minecraft.world.item.SpyglassItem#SpyglassItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:15 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SpyglassItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.SpyglassItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/SpyglassItem.java:29 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: playSound(), awardStat(), get(), startUsingInstantly(). คืนค่า: ItemUtils.startUsingInstantly(level, player, interactionHand).
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
SpyglassItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
StandingAndWallBlockItem
- Full name:
net.minecraft.world.item.StandingAndWallBlockItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/StandingAndWallBlockItem.java - Type:
class - Modifiers:
public - Extends:
BlockItem
net.minecraft.world.item.StandingAndWallBlockItem#canPlace(LevelReader,BlockState,BlockPos)
- Origin:
common - Source:
net/minecraft/world/item/StandingAndWallBlockItem.java:23 - Modifiers:
protected - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Place
ทำงานยังไง
เรียกต่อ: canSurvive(). คืนค่า: blockState.canSurvive(levelReader, blockPos).
Parameters
LevelReader levelReaderBlockState blockStateBlockPos blockPos
ตัวอย่างใช้งาน
LevelReader levelReader = ...;
BlockState blockState = ...;
BlockPos blockPos = ...;
@Override
protected boolean canPlace(LevelReader levelReader, BlockState blockState, BlockPos blockPos) {
return super.canPlace(levelReader, blockState, blockPos);
}
net.minecraft.world.item.StandingAndWallBlockItem#getPlacementState(BlockPlaceContext)
- Origin:
common - Source:
net/minecraft/world/item/StandingAndWallBlockItem.java:27 - Modifiers:
protected - Return:
BlockState
คืออะไร
อ่านค่า Placement State
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getStateForPlacement(), getLevel(), getClickedPos(), getNearestLookingDirections(), getOpposite(), getBlock(), canPlace(), isUnobstructed(). คืนค่า: blockState2 != null && levelReader.isUnobstructed(blockState2, blockPos, CollisionContext.empty()) ? blockState2 : null.
Parameters
BlockPlaceContext blockPlaceContext
ตัวอย่างใช้งาน
BlockPlaceContext blockPlaceContext = ...;
@Override
protected BlockState getPlacementState(BlockPlaceContext blockPlaceContext) {
return super.getPlacementState(blockPlaceContext);
}
net.minecraft.world.item.StandingAndWallBlockItem#registerBlocks(Map<Block, Item>,Item)
- Origin:
common - Source:
net/minecraft/world/item/StandingAndWallBlockItem.java:48 - Modifiers:
public - Return:
void
คืออะไร
ลงทะเบียน Blocks
ทำงานยังไง
เรียกต่อ: put().
Parameters
Map<Block, Item> mapItem item
ตัวอย่างใช้งาน
StandingAndWallBlockItem instance = ...;
Map<Block, Item> map = ...;
Item item = ...;
instance.registerBlocks(map, item);
net.minecraft.world.item.StandingAndWallBlockItem#StandingAndWallBlockItem(Block,Block,Direction,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/StandingAndWallBlockItem.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ StandingAndWallBlockItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: wallBlock, attachmentDirection.
Parameters
Block blockBlock block2Direction directionItem.Properties properties
ตัวอย่างใช้งาน
Block block = ...;
Block block2 = ...;
Direction direction = ...;
Item.Properties properties = ...;
StandingAndWallBlockItem instance = new StandingAndWallBlockItem(block, block2, direction, properties);
SwordItem
- Full name:
net.minecraft.world.item.SwordItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/SwordItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.SwordItem#canAttackBlock(BlockState,Level,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/SwordItem.java:15 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack Block
ทำงานยังไง
เรียกต่อ: isCreative(). คืนค่า: !player.isCreative().
Parameters
BlockState blockStateLevel levelBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
SwordItem instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
boolean result = instance.canAttackBlock(blockState, level, blockPos, player);
net.minecraft.world.item.SwordItem#hurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/SwordItem.java:20 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
คืนค่า: true.
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
SwordItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.SwordItem#postHurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/SwordItem.java:25 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ SwordItem
ทำงานยังไง
เรียกต่อ: hurtAndBreak().
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
SwordItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.SwordItem#SwordItem(ToolMaterial,float,float,Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/SwordItem.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ SwordItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: applySwordProperties().
Parameters
ToolMaterial toolMaterialfloat ffloat gItem.Properties properties
ตัวอย่างใช้งาน
ToolMaterial toolMaterial = ...;
Item.Properties properties = ...;
SwordItem instance = new SwordItem(toolMaterial, 0.0F, 0.0F, properties);
ThrowablePotionItem
- Full name:
net.minecraft.world.item.ThrowablePotionItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ThrowablePotionItem.java - Type:
class - Modifiers:
public - Extends:
PotionItem - Implements:
ProjectileItem
net.minecraft.world.item.ThrowablePotionItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/ThrowablePotionItem.java:33 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ ThrowablePotionItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(). สร้างออบเจ็กต์: ThrownPotion. คืนค่า: new ThrownPotion(level, position.x(), position.y(), position.z(), itemStack).
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
ThrowablePotionItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.ThrowablePotionItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/ThrowablePotionItem.java:38 - Modifiers:
public - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
เรียกต่อ: builder(), uncertainty(), power(), build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ThrowablePotionItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.ThrowablePotionItem#ThrowablePotionItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/ThrowablePotionItem.java:17 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ThrowablePotionItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
Item.Properties properties = ...;
ThrowablePotionItem instance = new ThrowablePotionItem(properties);
net.minecraft.world.item.ThrowablePotionItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/ThrowablePotionItem.java:21 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), spawnProjectileFromRotation(), awardStat(), get(), consume(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
ThrowablePotionItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
TippedArrowItem
- Full name:
net.minecraft.world.item.TippedArrowItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/TippedArrowItem.java - Type:
class - Modifiers:
public - Extends:
ArrowItem
net.minecraft.world.item.TippedArrowItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/TippedArrowItem.java:21 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ TippedArrowItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), addPotionTooltip(), tickRate().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
TippedArrowItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.TippedArrowItem#getDefaultInstance()
- Origin:
common - Source:
net/minecraft/world/item/TippedArrowItem.java:14 - Modifiers:
public - Return:
ItemStack
คืออะไร
อ่านค่า Default Instance
ทำงานยังไง
เรียกต่อ: set(). สร้างออบเจ็กต์: PotionContents. คืนค่า: itemStack.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.TippedArrowItem#getName(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/TippedArrowItem.java:29 - Modifiers:
public - Return:
Component
คืออะไร
อ่านค่า Name
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: potionContents != null ? potionContents.getName(this.descriptionId + ".effect.") : super.getName(itemStack).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
TippedArrowItem instance = ...;
ItemStack itemStack = ...;
Component result = instance.getName(itemStack);
net.minecraft.world.item.TippedArrowItem#TippedArrowItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/TippedArrowItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TippedArrowItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
ToolMaterial
- Full name:
net.minecraft.world.item.ToolMaterial - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/ToolMaterial.java - Type:
record - Modifiers:
public
net.minecraft.world.item.ToolMaterial#applySwordProperties(Item.Properties,float,float)
- Origin:
common - Source:
net/minecraft/world/item/ToolMaterial.java:58 - Modifiers:
public - Return:
Item.Properties
คืออะไร
นำไปใช้ Sword Properties
ทำงานยังไง
เรียกต่อ: acquireBootstrapRegistrationLookup(), applyCommonProperties(), component(), of(), minesAndDrops(), direct(), builtInRegistryHolder(), overrideSpeed(). สร้างออบเจ็กต์: Tool.
Parameters
Item.Properties propertiesfloat ffloat g
ตัวอย่างใช้งาน
ToolMaterial instance = ...;
Item.Properties properties = ...;
Item.Properties result = instance.applySwordProperties(properties, 0.0F, 0.0F);
net.minecraft.world.item.ToolMaterial#applyToolProperties(Item.Properties,TagKey<Block>,float,float)
- Origin:
common - Source:
net/minecraft/world/item/ToolMaterial.java:33 - Modifiers:
public - Return:
Item.Properties
คืออะไร
นำไปใช้ Tool Properties
ทำงานยังไง
เรียกต่อ: acquireBootstrapRegistrationLookup(), applyCommonProperties(), component(), of(), deniesDrops(), getOrThrow(), minesAndDrops(), attributes(). สร้างออบเจ็กต์: Tool.
Parameters
Item.Properties propertiesTagKey<Block> tagKeyfloat ffloat g
ตัวอย่างใช้งาน
ToolMaterial instance = ...;
Item.Properties properties = ...;
TagKey<Block> tagKey = ...;
Item.Properties result = instance.applyToolProperties(properties, tagKey, 0.0F, 0.0F);
TooltipFlag
- Full name:
net.minecraft.world.item.TooltipFlag - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/TooltipFlag.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.TooltipFlag#isAdvanced()
- Origin:
common - Source:
net/minecraft/world/item/TooltipFlag.java:7 - Modifiers: ``
- Return:
boolean
คืออะไร
ตรวจสอบสถานะ Advanced
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.TooltipFlag#isCreative()
- Origin:
common - Source:
net/minecraft/world/item/TooltipFlag.java:9 - Modifiers: ``
- Return:
boolean
คืออะไร
ตรวจสอบสถานะ Creative
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
TridentItem
- Full name:
net.minecraft.world.item.TridentItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/TridentItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.TridentItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:155 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ TridentItem
ทำงานยังไง
เรียกต่อ: x(), y(), z(), copyWithCount(). สร้างออบเจ็กต์: ThrownTrident. คืนค่า: thrownTrident.
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
TridentItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.TridentItem#canAttackBlock(BlockState,Level,BlockPos,Player)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:54 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Attack Block
ทำงานยังไง
เรียกต่อ: isCreative(). คืนค่า: !player.isCreative().
Parameters
BlockState blockStateLevel levelBlockPos blockPosPlayer player
ตัวอย่างใช้งาน
TridentItem instance = ...;
BlockState blockState = ...;
Level level = ...;
BlockPos blockPos = ...;
Player player = ...;
boolean result = instance.canAttackBlock(blockState, level, blockPos, player);
net.minecraft.world.item.TridentItem#createAttributes()
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:43 - Modifiers:
public static - Return:
ItemAttributeModifiers
คืออะไร
สร้าง Attributes
ทำงานยังไง
เรียกต่อ: builder(), add(), build(). สร้างออบเจ็กต์: AttributeModifier.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.TridentItem#createToolProperties()
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:50 - Modifiers:
public static - Return:
Tool
คืออะไร
สร้าง Tool Properties
ทำงานยังไง
เรียกต่อ: of(). สร้างออบเจ็กต์: Tool. คืนค่า: new Tool(List.of(), 1.0F, 2).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.TridentItem#getUseAnimation(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:59 - Modifiers:
public - Return:
ItemUseAnimation
คืออะไร
อ่านค่า Use Animation
ทำงานยังไง
คืนค่า: ItemUseAnimation.SPEAR.
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
TridentItem instance = ...;
ItemStack itemStack = ...;
ItemUseAnimation result = instance.getUseAnimation(itemStack);
net.minecraft.world.item.TridentItem#getUseDuration(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:64 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Use Duration
ทำงานยังไง
คืนค่า: 72000.
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
TridentItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
int result = instance.getUseDuration(itemStack, livingEntity);
net.minecraft.world.item.TridentItem#hurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:145 - Modifiers:
public - Return:
boolean
คืออะไร
ประมวลผลความเสียหาย Enemy
ทำงานยังไง
คืนค่า: true.
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
TridentItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
boolean result = instance.hurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.TridentItem#postHurtEnemy(ItemStack,LivingEntity,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:150 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ postHurtEnemy ตาม implementation ของ TridentItem
ทำงานยังไง
เรียกต่อ: hurtAndBreak().
Parameters
ItemStack itemStackLivingEntity livingEntityLivingEntity livingEntity2
ตัวอย่างใช้งาน
TridentItem instance = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
LivingEntity livingEntity2 = ...;
instance.postHurtEnemy(itemStack, livingEntity, livingEntity2);
net.minecraft.world.item.TridentItem#releaseUsing(ItemStack,Level,LivingEntity,int)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:69 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ releaseUsing ตาม implementation ของ TridentItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getUseDuration(), getTridentSpinAttackStrength(), isInWaterOrRain(), nextDamageWillBreak(), pickHighestLevel(), orElse(), awardStat(), get(). สร้างออบเจ็กต์: Vec3. มีจุด return อย่างน้อย 7 จุด.
Parameters
ItemStack itemStackLevel levelLivingEntity livingEntityint i
ตัวอย่างใช้งาน
TridentItem instance = ...;
ItemStack itemStack = ...;
Level level = ...;
LivingEntity livingEntity = ...;
boolean result = instance.releaseUsing(itemStack, level, livingEntity, 0);
net.minecraft.world.item.TridentItem#TridentItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:39 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TridentItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
net.minecraft.world.item.TridentItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/TridentItem.java:130 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), nextDamageWillBreak(), getTridentSpinAttackStrength(), isInWaterOrRain(), startUsingItem(). มีจุด return อย่างน้อย 3 จุด.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
TridentItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
WindChargeItem
- Full name:
net.minecraft.world.item.WindChargeItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/WindChargeItem.java - Type:
class - Modifiers:
public - Extends:
Item - Implements:
ProjectileItem
net.minecraft.world.item.WindChargeItem#asProjectile(Level,Position,ItemStack,Direction)
- Origin:
common - Source:
net/minecraft/world/item/WindChargeItem.java:56 - Modifiers:
public - Return:
Projectile
คืออะไร
ดำเนินการ asProjectile ตาม implementation ของ WindChargeItem
ทำงานยังไง
เรียกต่อ: getRandom(), triangle(), getStepX(), getStepY(), getStepZ(), x(), y(), z(). สร้างออบเจ็กต์: Vec3, WindCharge. คืนค่า: windCharge.
Parameters
Level levelPosition positionItemStack itemStackDirection direction
ตัวอย่างใช้งาน
WindChargeItem instance = ...;
Level level = ...;
Position position = ...;
ItemStack itemStack = ...;
Direction direction = ...;
Projectile result = instance.asProjectile(level, position, itemStack, direction);
net.minecraft.world.item.WindChargeItem#createDispenseConfig()
- Origin:
common - Source:
net/minecraft/world/item/WindChargeItem.java:72 - Modifiers:
public - Return:
ProjectileItem.DispenseConfig
คืออะไร
สร้าง Dispense Config
ทำงานยังไง
เรียกต่อ: builder(), positionFunction(), getDispensePosition(), uncertainty(), power(), overrideDispenseEvent(), build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
WindChargeItem instance = ...;
ProjectileItem.DispenseConfig result = instance.createDispenseConfig();
net.minecraft.world.item.WindChargeItem#shoot(Projectile,double,double,double,float,float)
- Origin:
common - Source:
net/minecraft/world/item/WindChargeItem.java:68 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ shoot ตาม implementation ของ WindChargeItem
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Projectile projectiledouble ddouble edouble ffloat gfloat h
ตัวอย่างใช้งาน
WindChargeItem instance = ...;
Projectile projectile = ...;
instance.shoot(projectile, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
net.minecraft.world.item.WindChargeItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/WindChargeItem.java:26 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemInHand(), spawnProjectileFromRotation(), position(), x(), getEyePosition(), y(), z(), playSound(). สร้างออบเจ็กต์: WindCharge. คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
WindChargeItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.WindChargeItem#WindChargeItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/WindChargeItem.java:22 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ WindChargeItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
WritableBookItem
- Full name:
net.minecraft.world.item.WritableBookItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/WritableBookItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.WritableBookItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/WritableBookItem.java:14 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: getItemInHand(), openItemGui(), awardStat(), get(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
WritableBookItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.WritableBookItem#WritableBookItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/WritableBookItem.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ WritableBookItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties
ตัวอย่างใช้งาน
WrittenBookItem
- Full name:
net.minecraft.world.item.WrittenBookItem - Package:
net.minecraft.world.item - Source:
common—net/minecraft/world/item/WrittenBookItem.java - Type:
class - Modifiers:
public - Extends:
Item
net.minecraft.world.item.WrittenBookItem#appendHoverText(ItemStack,Item.TooltipContext,List<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/WrittenBookItem.java:22 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ appendHoverText ตาม implementation ของ WrittenBookItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), isBlank(), author(), add(), translatable(), withStyle(), generation().
Parameters
ItemStack itemStackItem.TooltipContext tooltipContextList<Component> listTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
WrittenBookItem instance = ...;
ItemStack itemStack = ...;
Item.TooltipContext tooltipContext = ...;
List<Component> list = ...;
TooltipFlag tooltipFlag = ...;
instance.appendHoverText(itemStack, tooltipContext, list, tooltipFlag);
net.minecraft.world.item.WrittenBookItem#resolveBookComponents(ItemStack,CommandSourceStack,Player)
- Origin:
common - Source:
net/minecraft/world/item/WrittenBookItem.java:42 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ resolveBookComponents ตาม implementation ของ WrittenBookItem
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), resolved(), resolve(), set(), markResolved(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackCommandSourceStack commandSourceStackPlayer player
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
CommandSourceStack commandSourceStack = ...;
Player player = ...;
boolean result = WrittenBookItem.resolveBookComponents(itemStack, commandSourceStack, player);
net.minecraft.world.item.WrittenBookItem#use(Level,Player,InteractionHand)
- Origin:
common - Source:
net/minecraft/world/item/WrittenBookItem.java:34 - Modifiers:
public - Return:
InteractionResult
คืออะไร
ใช้งาน use
ทำงานยังไง
เรียกต่อ: getItemInHand(), openItemGui(), awardStat(), get(). คืนค่า: InteractionResult.SUCCESS.
Parameters
Level levelPlayer playerInteractionHand interactionHand
ตัวอย่างใช้งาน
WrittenBookItem instance = ...;
Level level = ...;
Player player = ...;
InteractionHand interactionHand = ...;
InteractionResult result = instance.use(level, player, interactionHand);
net.minecraft.world.item.WrittenBookItem#WrittenBookItem(Item.Properties)
- Origin:
common - Source:
net/minecraft/world/item/WrittenBookItem.java:18 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ WrittenBookItem ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
Item.Properties properties