Package net.minecraft.world.item.enchantment
Part 1/1
ConditionalEffect
- Full name:
net.minecraft.world.item.enchantment.ConditionalEffect - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/ConditionalEffect.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.ConditionalEffect#codec(Codec<T>,ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ConditionalEffect.java:28 - Modifiers:
public static - Return:
Codec<ConditionalEffect<T>>
คืออะไร
ดำเนินการ codec ตาม implementation ของ ConditionalEffect
ทำงานยังไง
เรียกต่อ: create(), group(), fieldOf(), forGetter(), conditionCodec(), optionalFieldOf(), apply().
Parameters
Codec<T> codecContextKeySet contextKeySet
ตัวอย่างใช้งาน
Codec<T> codec = ...;
ContextKeySet contextKeySet = ...;
Codec<ConditionalEffect<T>> result = ConditionalEffect.codec(codec, contextKeySet);
net.minecraft.world.item.enchantment.ConditionalEffect#conditionCodec(ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ConditionalEffect.java:14 - Modifiers:
public static - Return:
Codec<LootItemCondition>
คืออะไร
ดำเนินการ conditionCodec ตาม implementation ของ ConditionalEffect
ทำงานยังไง
เรียกต่อ: validate(), Collector(), getReport(), map(), error(), orElseGet(), success(). สร้างออบเจ็กต์: ProblemReporter.Collector, ValidationContext. คืนค่า: LootItemCondition.DIRECT_CODEC .validate( lootItemCondition -> { ProblemReporter.Collector collector = new ProblemReporter.Collector().
Parameters
ContextKeySet contextKeySet
ตัวอย่างใช้งาน
ContextKeySet contextKeySet = ...;
Codec<LootItemCondition> result = ConditionalEffect.conditionCodec(contextKeySet);
net.minecraft.world.item.enchantment.ConditionalEffect#matches(LootContext)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ConditionalEffect.java:38 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ matches ตาม implementation ของ ConditionalEffect
ทำงานยังไง
เรียกต่อ: isEmpty(), get(), test(). คืนค่า: this.requirements.isEmpty() ? true : this.requirements.get().test(lootContext).
Parameters
LootContext lootContext
ตัวอย่างใช้งาน
ConditionalEffect instance = ...;
LootContext lootContext = ...;
boolean result = instance.matches(lootContext);
Enchantable
- Full name:
net.minecraft.world.item.enchantment.Enchantable - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Enchantable.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.Enchantable#Enchantable(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantable.java:16 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ Enchantable ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. สร้างออบเจ็กต์: IllegalArgumentException.
Parameters
int value
ตัวอย่างใช้งาน
EnchantedItemInUse
- Full name:
net.minecraft.world.item.enchantment.EnchantedItemInUse - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/EnchantedItemInUse.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.EnchantedItemInUse#EnchantedItemInUse(ItemStack,EquipmentSlot,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantedItemInUse.java:11 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EnchantedItemInUse ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: onEquippedItemBroken().
Parameters
ItemStack itemStackEquipmentSlot equipmentSlotLivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
EquipmentSlot equipmentSlot = ...;
LivingEntity livingEntity = ...;
EnchantedItemInUse instance = new EnchantedItemInUse(itemStack, equipmentSlot, livingEntity);
Enchantment
- Full name:
net.minecraft.world.item.enchantment.Enchantment - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Enchantment.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.Enchantment#areCompatible(Holder<Enchantment>,Holder<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:161 - Modifiers:
public static - Return:
boolean
คืออะไร
ดำเนินการ areCompatible ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: equals(), value(), contains(). คืนค่า: !holder.equals(holder2) && !holder.value().exclusiveSet.contains(holder2) && !holder2.value().exclusiveSet.contains(holder).
Parameters
Holder<Enchantment> holderHolder<Enchantment> holder2
ตัวอย่างใช้งาน
Holder<Enchantment> holder = ...;
Holder<Enchantment> holder2 = ...;
boolean result = Enchantment.areCompatible(holder, holder2);
net.minecraft.world.item.enchantment.Enchantment#canEnchant(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:180 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Enchant
ทำงานยังไง
เรียกต่อ: supportedItems(), contains(), getItemHolder(). คืนค่า: this.definition.supportedItems().contains(itemStack.getItemHolder()).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Enchantment instance = ...;
ItemStack itemStack = ...;
boolean result = instance.canEnchant(itemStack);
net.minecraft.world.item.enchantment.Enchantment#constantCost(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:74 - Modifiers:
public static - Return:
Enchantment.Cost
คืออะไร
ดำเนินการ constantCost ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: Cost(). สร้างออบเจ็กต์: Enchantment.Cost. คืนค่า: new Enchantment.Cost(i, 0).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#damageContext(ServerLevel,int,Entity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:384 - Modifiers:
public static - Return:
LootContext
คืออะไร
สร้าง/คำนวณความเสียหาย Context
ทำงานยังไง
เรียกต่อ: Builder(), withParameter(), position(), withOptionalParameter(), getEntity(), getDirectEntity(), create(), empty(). สร้างออบเจ็กต์: LootParams.Builder, LootContext.Builder. คืนค่า: new LootContext.Builder(lootParams).create(Optional.empty()).
Parameters
ServerLevel serverLevelint iEntity entityDamageSource damageSource
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Entity entity = ...;
DamageSource damageSource = ...;
LootContext result = Enchantment.damageContext(serverLevel, 0, entity, damageSource);
net.minecraft.world.item.enchantment.Enchantment#definition(HolderSet<Item>,HolderSet<Item>,int,int,Enchantment.Cost,Enchantment.Cost,int,EquipmentSlotGroup[])
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:82 - Modifiers:
public static - Return:
Enchantment.EnchantmentDefinition
คืออะไร
ดำเนินการ definition ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: EnchantmentDefinition(), of(). สร้างออบเจ็กต์: Enchantment.EnchantmentDefinition. คืนค่า: new Enchantment.EnchantmentDefinition(holderSet, Optional.of(holderSet2), i, j, cost, cost2, k, List.of(equipmentSlotGroups)).
Parameters
HolderSet<Item> holderSetHolderSet<Item> holderSet2int iint jEnchantment.Cost costEnchantment.Cost cost2int kEquipmentSlotGroup[] equipmentSlotGroups
ตัวอย่างใช้งาน
HolderSet<Item> holderSet = ...;
HolderSet<Item> holderSet2 = ...;
Enchantment.Cost cost = ...;
Enchantment.Cost cost2 = ...;
EquipmentSlotGroup[] equipmentSlotGroups = ...;
Enchantment.EnchantmentDefinition result = Enchantment.definition(holderSet, holderSet2, 0, 0, cost, cost2, 0, equipmentSlotGroups);
net.minecraft.world.item.enchantment.Enchantment#definition(HolderSet<Item>,int,int,Enchantment.Cost,Enchantment.Cost,int,EquipmentSlotGroup[])
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:95 - Modifiers:
public static - Return:
Enchantment.EnchantmentDefinition
คืออะไร
ดำเนินการ definition ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: EnchantmentDefinition(), empty(), of(). สร้างออบเจ็กต์: Enchantment.EnchantmentDefinition. คืนค่า: new Enchantment.EnchantmentDefinition(holderSet, Optional.empty(), i, j, cost, cost2, k, List.of(equipmentSlotGroups)).
Parameters
HolderSet<Item> holderSetint iint jEnchantment.Cost costEnchantment.Cost cost2int kEquipmentSlotGroup[] equipmentSlotGroups
ตัวอย่างใช้งาน
HolderSet<Item> holderSet = ...;
Enchantment.Cost cost = ...;
Enchantment.Cost cost2 = ...;
EquipmentSlotGroup[] equipmentSlotGroups = ...;
Enchantment.EnchantmentDefinition result = Enchantment.definition(holderSet, 0, 0, cost, cost2, 0, equipmentSlotGroups);
net.minecraft.world.item.enchantment.Enchantment#doPostAttack(ServerLevel,int,EnchantedItemInUse,EnchantmentTarget,Entity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:266 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ doPostAttack ตาม implementation ของ Enchantment
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getEffects(), enchanted().
Parameters
ServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseEnchantmentTarget enchantmentTargetEntity entityDamageSource damageSource
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
EnchantmentTarget enchantmentTarget = ...;
Entity entity = ...;
DamageSource damageSource = ...;
instance.doPostAttack(serverLevel, 0, enchantedItemInUse, enchantmentTarget, entity, damageSource);
net.minecraft.world.item.enchantment.Enchantment#doPostAttack(TargetedConditionalEffect<EnchantmentEntityEffect>,ServerLevel,int,EnchantedItemInUse,Entity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:276 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ doPostAttack ตาม implementation ของ Enchantment
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: matches(), damageContext(), affected(), getEntity(), getDirectEntity(), effect(), apply(), position().
Parameters
TargetedConditionalEffect<EnchantmentEntityEffect> targetedConditionalEffectServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseEntity entityDamageSource damageSource
ตัวอย่างใช้งาน
TargetedConditionalEffect<EnchantmentEntityEffect> targetedConditionalEffect = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
Entity entity = ...;
DamageSource damageSource = ...;
Enchantment.doPostAttack(targetedConditionalEffect, serverLevel, 0, enchantedItemInUse, entity, damageSource);
net.minecraft.world.item.enchantment.Enchantment#dynamicCost(int,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:78 - Modifiers:
public static - Return:
Enchantment.Cost
คืออะไร
ดำเนินการ dynamicCost ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: Cost(). สร้างออบเจ็กต์: Enchantment.Cost. คืนค่า: new Enchantment.Cost(i, j).
Parameters
int iint j
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#enchantment(Enchantment.EnchantmentDefinition)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:491 - Modifiers:
public static - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ enchantment ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: Enchantment.Builder. คืนค่า: new Enchantment.Builder(enchantmentDefinition).
Parameters
Enchantment.EnchantmentDefinition enchantmentDefinition
ตัวอย่างใช้งาน
Enchantment.EnchantmentDefinition enchantmentDefinition = ...;
Enchantment.Builder result = Enchantment.enchantment(enchantmentDefinition);
net.minecraft.world.item.enchantment.Enchantment#getAnvilCost()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:136 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Anvil Cost
ทำงานยังไง
เรียกต่อ: anvilCost(). คืนค่า: this.definition.anvilCost().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getEffects(DataComponentType<List<T>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:184 - Modifiers:
public - Return:
List<T>
คืออะไร
อ่านค่า Effects
ทำงานยังไง
เรียกต่อ: getOrDefault(), of(). คืนค่า: this.effects.getOrDefault(dataComponentType, List.of()).
Parameters
DataComponentType<List<T>> dataComponentType
ตัวอย่างใช้งาน
Enchantment instance = ...;
DataComponentType<List<T>> dataComponentType = ...;
List<T> result = instance.getEffects(dataComponentType);
net.minecraft.world.item.enchantment.Enchantment#getFullname(Holder<Enchantment>,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:165 - Modifiers:
public static - Return:
Component
คืออะไร
อ่านค่า Fullname
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: value(), copy(), is(), mergeStyles(), withColor(), getMaxLevel(), append(), translatable(). คืนค่า: mutableComponent.
Parameters
Holder<Enchantment> holderint i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getMaxCost(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:152 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Max Cost
ทำงานยังไง
เรียกต่อ: maxCost(), calculate(). คืนค่า: this.definition.maxCost().calculate(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getMaxLevel()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:144 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Max Level
ทำงานยังไง
เรียกต่อ: maxLevel(). คืนค่า: this.definition.maxLevel().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getMinCost(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:148 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Min Cost
ทำงานยังไง
เรียกต่อ: minCost(), calculate(). คืนค่า: this.definition.minCost().calculate(i).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getMinLevel()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:140 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Min Level
ทำงานยังไง
คืนค่า: 1.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getSlotItems(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:101 - Modifiers:
public - Return:
Map<EquipmentSlot, ItemStack>
คืออะไร
อ่านค่า Slot Items
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newEnumMap(), matchingSlot(), getItemBySlot(), isEmpty(), put(). คืนค่า: map.
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
Enchantment instance = ...;
LivingEntity livingEntity = ...;
Map<EquipmentSlot, ItemStack> result = instance.getSlotItems(livingEntity);
net.minecraft.world.item.enchantment.Enchantment#getSupportedItems()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:116 - Modifiers:
public - Return:
HolderSet<Item>
คืออะไร
อ่านค่า Supported Items
ทำงานยังไง
เรียกต่อ: supportedItems(). คืนค่า: this.definition.supportedItems().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#getWeight()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:132 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Weight
ทำงานยังไง
เรียกต่อ: weight(). คืนค่า: this.definition.weight().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.Enchantment#isImmuneToDamage(ServerLevel,int,Entity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:188 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Immune To Damage
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: damageContext(), getEffects(), matches(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ServerLevel serverLevelint iEntity entityDamageSource damageSource
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
Entity entity = ...;
DamageSource damageSource = ...;
boolean result = instance.isImmuneToDamage(serverLevel, 0, entity, damageSource);
net.minecraft.world.item.enchantment.Enchantment#isPrimaryItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:124 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Primary Item
ทำงานยังไง
เรียกต่อ: isSupportedItem(), isEmpty(), is(), get(). คืนค่า: this.isSupportedItem(itemStack) && (this.definition.primaryItems.isEmpty() || itemStack.is(this.definition.primaryItems.get())).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Enchantment instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isPrimaryItem(itemStack);
net.minecraft.world.item.enchantment.Enchantment#isSupportedItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:128 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Supported Item
ทำงานยังไง
เรียกต่อ: is(). คืนค่า: itemStack.is(this.definition.supportedItems).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Enchantment instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isSupportedItem(itemStack);
net.minecraft.world.item.enchantment.Enchantment#matchingSlot(EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:120 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ matchingSlot ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: slots(), stream(), anyMatch(), test(). คืนค่า: this.definition.slots().stream().anyMatch(equipmentSlotGroup -> equipmentSlotGroup.test(equipmentSlot)).
Parameters
EquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
Enchantment instance = ...;
EquipmentSlot equipmentSlot = ...;
boolean result = instance.matchingSlot(equipmentSlot);
net.minecraft.world.item.enchantment.Enchantment#modifyAmmoCount(ServerLevel,int,ItemStack,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:214 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyAmmoCount ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyItemFilteredCount().
Parameters
ServerLevel serverLevelint iItemStack itemStackMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MutableFloat mutableFloat = ...;
instance.modifyAmmoCount(serverLevel, 0, itemStack, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyArmorEffectivness(ServerLevel,int,ItemStack,Entity,DamageSource,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:262 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyArmorEffectivness ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyDamageFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityDamageSource damageSourceMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyArmorEffectivness(serverLevel, 0, itemStack, entity, damageSource, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyBlockExperience(ServerLevel,int,ItemStack,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:222 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyBlockExperience ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyItemFilteredCount().
Parameters
ServerLevel serverLevelint iItemStack itemStackMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MutableFloat mutableFloat = ...;
instance.modifyBlockExperience(serverLevel, 0, itemStack, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyCrossbowChargeTime(RandomSource,int,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:304 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyCrossbowChargeTime ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyUnfilteredValue().
Parameters
RandomSource randomSourceint iMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
RandomSource randomSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyCrossbowChargeTime(randomSource, 0, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyDamage(ServerLevel,int,ItemStack,Entity,DamageSource,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:250 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyDamage ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyDamageFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityDamageSource damageSourceMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyDamage(serverLevel, 0, itemStack, entity, damageSource, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyDamageProtection(ServerLevel,int,ItemStack,Entity,DamageSource,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:200 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyDamageProtection ตาม implementation ของ Enchantment
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: damageContext(), getEffects(), matches(), setValue(), effect(), process(), getRandom(), floatValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityDamageSource damageSourceMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyDamageProtection(serverLevel, 0, itemStack, entity, damageSource, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyDurabilityChange(ServerLevel,int,ItemStack,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:210 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyDurabilityChange ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyItemFilteredCount().
Parameters
ServerLevel serverLevelint iItemStack itemStackMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MutableFloat mutableFloat = ...;
instance.modifyDurabilityChange(serverLevel, 0, itemStack, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyDurabilityToRepairFromXp(ServerLevel,int,ItemStack,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:230 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyDurabilityToRepairFromXp ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyItemFilteredCount().
Parameters
ServerLevel serverLevelint iItemStack itemStackMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MutableFloat mutableFloat = ...;
instance.modifyDurabilityToRepairFromXp(serverLevel, 0, itemStack, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyFallBasedDamage(ServerLevel,int,ItemStack,Entity,DamageSource,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:254 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyFallBasedDamage ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyDamageFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityDamageSource damageSourceMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyFallBasedDamage(serverLevel, 0, itemStack, entity, damageSource, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyFishingLuckBonus(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:246 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyFishingLuckBonus ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyFishingLuckBonus(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyFishingTimeReduction(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:242 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyFishingTimeReduction ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyFishingTimeReduction(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyKnockback(ServerLevel,int,ItemStack,Entity,DamageSource,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:258 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyKnockback ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyDamageFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityDamageSource damageSourceMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyKnockback(serverLevel, 0, itemStack, entity, damageSource, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyMobExperience(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:226 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyMobExperience ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyMobExperience(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyPiercingCount(ServerLevel,int,ItemStack,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:218 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyPiercingCount ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyItemFilteredCount().
Parameters
ServerLevel serverLevelint iItemStack itemStackMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
MutableFloat mutableFloat = ...;
instance.modifyPiercingCount(serverLevel, 0, itemStack, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyProjectileCount(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:296 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyProjectileCount ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyProjectileCount(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyProjectileSpread(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:300 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyProjectileSpread ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyProjectileSpread(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyTridentReturnToOwnerAcceleration(ServerLevel,int,ItemStack,Entity,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:234 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyTridentReturnToOwnerAcceleration ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyEntityFilteredValue().
Parameters
ServerLevel serverLevelint iItemStack itemStackEntity entityMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
MutableFloat mutableFloat = ...;
instance.modifyTridentReturnToOwnerAcceleration(serverLevel, 0, itemStack, entity, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyTridentSpinAttackStrength(RandomSource,int,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:238 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyTridentSpinAttackStrength ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: modifyUnfilteredValue().
Parameters
RandomSource randomSourceint iMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
RandomSource randomSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyTridentSpinAttackStrength(randomSource, 0, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#modifyUnfilteredValue(DataComponentType<EnchantmentValueEffect>,RandomSource,int,MutableFloat)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:308 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ modifyUnfilteredValue ตาม implementation ของ Enchantment
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), setValue(), process(), floatValue().
Parameters
DataComponentType<EnchantmentValueEffect> dataComponentTypeRandomSource randomSourceint iMutableFloat mutableFloat
ตัวอย่างใช้งาน
Enchantment instance = ...;
DataComponentType<EnchantmentValueEffect> dataComponentType = ...;
RandomSource randomSource = ...;
MutableFloat mutableFloat = ...;
instance.modifyUnfilteredValue(dataComponentType, randomSource, 0, mutableFloat);
net.minecraft.world.item.enchantment.Enchantment#onHitBlock(ServerLevel,int,EnchantedItemInUse,Entity,Vec3,BlockState)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:331 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Hit Block
ทำงานยังไง
เรียกต่อ: applyEffects(), getEffects(), blockHitContext(), apply().
Parameters
ServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseEntity entityVec3 vec3BlockState blockState
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
Entity entity = ...;
Vec3 vec3 = ...;
BlockState blockState = ...;
instance.onHitBlock(serverLevel, 0, enchantedItemInUse, entity, vec3, blockState);
net.minecraft.world.item.enchantment.Enchantment#onProjectileSpawned(ServerLevel,int,EnchantedItemInUse,Entity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:323 - Modifiers:
public - Return:
void
คืออะไร
จัดการเหตุการณ์ Projectile Spawned
ทำงานยังไง
เรียกต่อ: applyEffects(), getEffects(), entityContext(), position(), apply().
Parameters
ServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseEntity entity
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
Entity entity = ...;
instance.onProjectileSpawned(serverLevel, 0, enchantedItemInUse, entity);
net.minecraft.world.item.enchantment.Enchantment#runLocationChangedEffects(ServerLevel,int,EnchantedItemInUse,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:441 - Modifiers:
public - Return:
void
คืออะไร
สั่งทำงาน Location Changed Effects
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: inSlot(), activeLocationDependentEnchantments(), matchingSlot(), remove(), forEach(), onDeactivated(), position(), get(). สร้างออบเจ็กต์: ObjectArraySet<>.
Parameters
ServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseLivingEntity livingEntity
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
LivingEntity livingEntity = ...;
instance.runLocationChangedEffects(serverLevel, 0, enchantedItemInUse, livingEntity);
net.minecraft.world.item.enchantment.Enchantment#stopLocationBasedEffects(int,EnchantedItemInUse,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:479 - Modifiers:
public - Return:
void
คืออะไร
หยุด Location Based Effects
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: inSlot(), activeLocationDependentEnchantments(), remove(), onDeactivated(), position().
Parameters
int iEnchantedItemInUse enchantedItemInUseLivingEntity livingEntity
ตัวอย่างใช้งาน
Enchantment instance = ...;
EnchantedItemInUse enchantedItemInUse = ...;
LivingEntity livingEntity = ...;
instance.stopLocationBasedEffects(0, enchantedItemInUse, livingEntity);
net.minecraft.world.item.enchantment.Enchantment#tick(ServerLevel,int,EnchantedItemInUse,Entity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:315 - Modifiers:
public - Return:
void
คืออะไร
ประมวลผล tick tick
ทำงานยังไง
เรียกต่อ: applyEffects(), getEffects(), entityContext(), position(), apply().
Parameters
ServerLevel serverLevelint iEnchantedItemInUse enchantedItemInUseEntity entity
ตัวอย่างใช้งาน
Enchantment instance = ...;
ServerLevel serverLevel = ...;
EnchantedItemInUse enchantedItemInUse = ...;
Entity entity = ...;
instance.tick(serverLevel, 0, enchantedItemInUse, entity);
net.minecraft.world.item.enchantment.Enchantment#toString()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:156 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ Enchantment
ทำงานยังไง
เรียกต่อ: getString(). คืนค่า: "Enchantment " + this.description.getString().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
Enchantment$Builder
- Full name:
net.minecraft.world.item.enchantment.Enchantment$Builder - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Enchantment.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.enchantment.Enchantment$Builder#build(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:563 - Modifiers:
public - Return:
Enchantment
คืออะไร
สร้าง build
ทำงานยังไง
เรียกต่อ: translatable(), makeDescriptionId(). สร้างออบเจ็กต์: Enchantment.
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
ResourceLocation resourceLocation = ...;
Enchantment result = instance.build(resourceLocation);
net.minecraft.world.item.enchantment.Enchantment$Builder#Builder(Enchantment.EnchantmentDefinition)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:501 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ Enchantment.Builder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: definition.
Parameters
Enchantment.EnchantmentDefinition enchantmentDefinition
ตัวอย่างใช้งาน
Enchantment.EnchantmentDefinition enchantmentDefinition = ...;
Enchantment.Builder instance = new Enchantment.Builder(enchantmentDefinition);
net.minecraft.world.item.enchantment.Enchantment$Builder#exclusiveWith(HolderSet<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:505 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ exclusiveWith ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
แก้ state: exclusiveSet. คืนค่า: this.
Parameters
HolderSet<Enchantment> holderSet
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
HolderSet<Enchantment> holderSet = ...;
Enchantment.Builder result = instance.exclusiveWith(holderSet);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<List<ConditionalEffect<E>>>,E)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:515 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: getEffectsList(), add(), empty(). สร้างออบเจ็กต์: ConditionalEffect<>. คืนค่า: this.
Parameters
DataComponentType<List<ConditionalEffect<E>>> dataComponentTypeE object
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<List<ConditionalEffect<E>>> dataComponentType = ...;
E object = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType, object);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<List<ConditionalEffect<E>>>,E,LootItemCondition.Builder)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:510 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: getEffectsList(), add(), of(), build(). สร้างออบเจ็กต์: ConditionalEffect<>. คืนค่า: this.
Parameters
DataComponentType<List<ConditionalEffect<E>>> dataComponentTypeE objectLootItemCondition.Builder builder
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<List<ConditionalEffect<E>>> dataComponentType = ...;
E object = ...;
LootItemCondition.Builder builder = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType, object, builder);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<List<EnchantmentAttributeEffect>>,EnchantmentAttributeEffect)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:538 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: getEffectsList(), add(). คืนค่า: this.
Parameters
DataComponentType<List<EnchantmentAttributeEffect>> dataComponentTypeEnchantmentAttributeEffect enchantmentAttributeEffect
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<List<EnchantmentAttributeEffect>> dataComponentType = ...;
EnchantmentAttributeEffect enchantmentAttributeEffect = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType, enchantmentAttributeEffect);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<List<TargetedConditionalEffect<E>>>,EnchantmentTarget,EnchantmentTarget,E)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:531 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: getEffectsList(), add(), empty(). สร้างออบเจ็กต์: TargetedConditionalEffect<>. คืนค่า: this.
Parameters
DataComponentType<List<TargetedConditionalEffect<E>>> dataComponentTypeEnchantmentTarget enchantmentTargetEnchantmentTarget enchantmentTarget2E object
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<List<TargetedConditionalEffect<E>>> dataComponentType = ...;
EnchantmentTarget enchantmentTarget = ...;
EnchantmentTarget enchantmentTarget2 = ...;
E object = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType, enchantmentTarget, enchantmentTarget2, object);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<List<TargetedConditionalEffect<E>>>,EnchantmentTarget,EnchantmentTarget,E,LootItemCondition.Builder)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:520 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: getEffectsList(), add(), of(), build(). สร้างออบเจ็กต์: TargetedConditionalEffect<>. คืนค่า: this.
Parameters
DataComponentType<List<TargetedConditionalEffect<E>>> dataComponentTypeEnchantmentTarget enchantmentTargetEnchantmentTarget enchantmentTarget2E objectLootItemCondition.Builder builder
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<List<TargetedConditionalEffect<E>>> dataComponentType = ...;
EnchantmentTarget enchantmentTarget = ...;
EnchantmentTarget enchantmentTarget2 = ...;
E object = ...;
LootItemCondition.Builder builder = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType, enchantmentTarget, enchantmentTarget2, object, builder);
net.minecraft.world.item.enchantment.Enchantment$Builder#withEffect(DataComponentType<Unit>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:550 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: set(). คืนค่า: this.
Parameters
DataComponentType<Unit> dataComponentType
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<Unit> dataComponentType = ...;
Enchantment.Builder result = instance.withEffect(dataComponentType);
net.minecraft.world.item.enchantment.Enchantment$Builder#withSpecialEffect(DataComponentType<E>,E)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:545 - Modifiers:
public - Return:
Enchantment.Builder
คืออะไร
ดำเนินการ withSpecialEffect ตาม implementation ของ Enchantment$Builder
ทำงานยังไง
เรียกต่อ: set(). คืนค่า: this.
Parameters
DataComponentType<E> dataComponentTypeE object
ตัวอย่างใช้งาน
Enchantment.Builder instance = ...;
DataComponentType<E> dataComponentType = ...;
E object = ...;
Enchantment.Builder result = instance.withSpecialEffect(dataComponentType, object);
Enchantment$Cost
- Full name:
net.minecraft.world.item.enchantment.Enchantment$Cost - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Enchantment.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.Enchantment$Cost#calculate(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantment.java:578 - Modifiers:
public - Return:
int
คืออะไร
คำนวณ calculate
ทำงานยังไง
คืนค่า: this.base + this.perLevelAboveFirst * (i - 1).
Parameters
int i
ตัวอย่างใช้งาน
EnchantmentEffectComponents
- Full name:
net.minecraft.world.item.enchantment.EnchantmentEffectComponents - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/EnchantmentEffectComponents.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.enchantment.EnchantmentEffectComponents#bootstrap(Registry<DataComponentType<?>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentEffectComponents.java:112 - Modifiers:
static - Return:
DataComponentType<?>
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ EnchantmentEffectComponents
ทำงานยังไง
คืนค่า: DAMAGE_PROTECTION.
Parameters
Registry<DataComponentType<?>> registry
ตัวอย่างใช้งาน
Registry<DataComponentType<?>> registry = ...;
DataComponentType<?> result = EnchantmentEffectComponents.bootstrap(registry);
EnchantmentHelper
- Full name:
net.minecraft.world.item.enchantment.EnchantmentHelper - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/EnchantmentHelper.java - Type:
class - Modifiers:
public
net.minecraft.world.item.enchantment.EnchantmentHelper#canStoreEnchantments(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:68 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่าสามารถ Store Enchantments
ทำงานยังไง
เรียกต่อ: has(), getComponentType(). คืนค่า: itemStack.has(getComponentType(itemStack)).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.EnchantmentHelper#createBook(EnchantmentInstance)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:120 - Modifiers:
public static - Return:
ItemStack
คืออะไร
สร้าง Book
ทำงานยังไง
เรียกต่อ: enchant(). สร้างออบเจ็กต์: ItemStack. คืนค่า: itemStack.
Parameters
EnchantmentInstance enchantmentInstance
ตัวอย่างใช้งาน
EnchantmentInstance enchantmentInstance = ...;
ItemStack result = EnchantmentHelper.createBook(enchantmentInstance);
net.minecraft.world.item.enchantment.EnchantmentHelper#doPostAttackEffects(ServerLevel,Entity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:203 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ doPostAttackEffects ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getEntity(), doPostAttackEffectsWithItemSource(), getWeaponItem().
Parameters
ServerLevel serverLevelEntity entityDamageSource damageSource
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Entity entity = ...;
DamageSource damageSource = ...;
EnchantmentHelper.doPostAttackEffects(serverLevel, entity, damageSource);
net.minecraft.world.item.enchantment.EnchantmentHelper#doPostAttackEffectsWithItemSource(ServerLevel,Entity,DamageSource,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:211 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ doPostAttackEffectsWithItemSource ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: doPostAttackEffectsWithItemSourceOnBreak().
Parameters
ServerLevel serverLevelEntity entityDamageSource damageSourceItemStack itemStack
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Entity entity = ...;
DamageSource damageSource = ...;
ItemStack itemStack = ...;
EnchantmentHelper.doPostAttackEffectsWithItemSource(serverLevel, entity, damageSource, itemStack);
net.minecraft.world.item.enchantment.EnchantmentHelper#doPostAttackEffectsWithItemSourceOnBreak(ServerLevel,Entity,DamageSource,ItemStack,Consumer<Item>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:215 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ doPostAttackEffectsWithItemSourceOnBreak ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnEquipment(), value(), doPostAttack(), getEntity(), runIterationOnItem(). สร้างออบเจ็กต์: EnchantedItemInUse.
Parameters
ServerLevel serverLevelEntity entityDamageSource damageSourceItemStack itemStackConsumer<Item> consumer
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Entity entity = ...;
DamageSource damageSource = ...;
ItemStack itemStack = ...;
Consumer<Item> consumer = ...;
EnchantmentHelper.doPostAttackEffectsWithItemSourceOnBreak(serverLevel, entity, damageSource, itemStack, consumer);
net.minecraft.world.item.enchantment.EnchantmentHelper#enchantItem(RandomSource,ItemStack,int,RegistryAccess,Optional<? extends HolderSet<Enchantment>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:504 - Modifiers:
public static - Return:
ItemStack
คืออะไร
ดำเนินการ enchantItem ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: map(), orElseGet(), lookupOrThrow(), listElements().
Parameters
RandomSource randomSourceItemStack itemStackint iRegistryAccess registryAccessOptional<? extends HolderSet<Enchantment>> optional
ตัวอย่างใช้งาน
RandomSource randomSource = ...;
ItemStack itemStack = ...;
RegistryAccess registryAccess = ...;
Optional<? extends HolderSet<Enchantment>> optional = ...;
ItemStack result = EnchantmentHelper.enchantItem(randomSource, itemStack, 0, registryAccess, optional);
net.minecraft.world.item.enchantment.EnchantmentHelper#enchantItem(RandomSource,ItemStack,int,Stream<Holder<Enchantment>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:516 - Modifiers:
public static - Return:
ItemStack
คืออะไร
ดำเนินการ enchantItem ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: selectEnchantment(), is(), enchant(). สร้างออบเจ็กต์: ItemStack. คืนค่า: itemStack.
Parameters
RandomSource randomSourceItemStack itemStackint iStream<Holder<Enchantment>> stream
ตัวอย่างใช้งาน
RandomSource randomSource = ...;
ItemStack itemStack = ...;
Stream<Holder<Enchantment>> stream = ...;
ItemStack result = EnchantmentHelper.enchantItem(randomSource, itemStack, 0, stream);
net.minecraft.world.item.enchantment.EnchantmentHelper#enchantItemFromProvider(ItemStack,RegistryAccess,ResourceKey<EnchantmentProvider>,DifficultyInstance,RandomSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:590 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ enchantItemFromProvider ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: lookupOrThrow(), getValue(), updateEnchantments(), enchant().
Parameters
ItemStack itemStackRegistryAccess registryAccessResourceKey<EnchantmentProvider> resourceKeyDifficultyInstance difficultyInstanceRandomSource randomSource
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
RegistryAccess registryAccess = ...;
ResourceKey<EnchantmentProvider> resourceKey = ...;
DifficultyInstance difficultyInstance = ...;
RandomSource randomSource = ...;
EnchantmentHelper.enchantItemFromProvider(itemStack, registryAccess, resourceKey, difficultyInstance, randomSource);
net.minecraft.world.item.enchantment.EnchantmentHelper#filterCompatibleEnchantments(List<EnchantmentInstance>,EnchantmentInstance)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:560 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ filterCompatibleEnchantments ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: removeIf(), areCompatible().
Parameters
List<EnchantmentInstance> listEnchantmentInstance enchantmentInstance
ตัวอย่างใช้งาน
List<EnchantmentInstance> list = ...;
EnchantmentInstance enchantmentInstance = ...;
EnchantmentHelper.filterCompatibleEnchantments(list, enchantmentInstance);
net.minecraft.world.item.enchantment.EnchantmentHelper#forEachModifier(ItemStack,EquipmentSlot,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:380 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ forEachModifier ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnItem(), value(), getEffects(), forEach(), matchingSlot(), accept(), attribute(), getModifier().
Parameters
ItemStack itemStackEquipmentSlot equipmentSlotBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
EquipmentSlot equipmentSlot = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
EnchantmentHelper.forEachModifier(itemStack, equipmentSlot, biConsumer);
net.minecraft.world.item.enchantment.EnchantmentHelper#forEachModifier(ItemStack,EquipmentSlotGroup,BiConsumer<Holder<Attribute>, AttributeModifier>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:372 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ forEachModifier ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnItem(), value(), getEffects(), forEach(), definition(), slots(), contains(), accept().
Parameters
ItemStack itemStackEquipmentSlotGroup equipmentSlotGroupBiConsumer<Holder<Attribute>, AttributeModifier> biConsumer
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
EquipmentSlotGroup equipmentSlotGroup = ...;
BiConsumer<Holder<Attribute>, AttributeModifier> biConsumer = ...;
EnchantmentHelper.forEachModifier(itemStack, equipmentSlotGroup, biConsumer);
net.minecraft.world.item.enchantment.EnchantmentHelper#getAvailableEnchantmentResults(int,ItemStack,Stream<Holder<Enchantment>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:574 - Modifiers:
public static - Return:
List<EnchantmentInstance>
คืออะไร
อ่านค่า Available Enchantment Results
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newArrayList(), is(), filter(), value(), isPrimaryItem(), forEach(), getMaxLevel(), getMinLevel(). สร้างออบเจ็กต์: EnchantmentInstance. คืนค่า: list.
Parameters
int iItemStack itemStackStream<Holder<Enchantment>> stream
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Stream<Holder<Enchantment>> stream = ...;
List<EnchantmentInstance> result = EnchantmentHelper.getAvailableEnchantmentResults(0, itemStack, stream);
net.minecraft.world.item.enchantment.EnchantmentHelper#getDamageProtection(ServerLevel,LivingEntity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:169 - Modifiers:
public static - Return:
float
คืออะไร
อ่านค่า Damage Protection
ทำงานยังไง
เรียกต่อ: runIterationOnEquipment(), value(), modifyDamageProtection(), itemStack(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelLivingEntity livingEntityDamageSource damageSource
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.getDamageProtection(serverLevel, livingEntity, damageSource);
net.minecraft.world.item.enchantment.EnchantmentHelper#getEnchantmentCost(RandomSource,int,int,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:486 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Enchantment Cost
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), nextInt(), max(). มีจุด return อย่างน้อย 3 จุด.
Parameters
RandomSource randomSourceint iint jItemStack itemStack
ตัวอย่างใช้งาน
RandomSource randomSource = ...;
ItemStack itemStack = ...;
int result = EnchantmentHelper.getEnchantmentCost(randomSource, 0, 0, itemStack);
net.minecraft.world.item.enchantment.EnchantmentHelper#getEnchantmentLevel(Holder<Enchantment>,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:271 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Enchantment Level
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: value(), getSlotItems(), values(), getItemEnchantmentLevel(). คืนค่า: i.
Parameters
Holder<Enchantment> holderLivingEntity livingEntity
ตัวอย่างใช้งาน
Holder<Enchantment> holder = ...;
LivingEntity livingEntity = ...;
int result = EnchantmentHelper.getEnchantmentLevel(holder, livingEntity);
net.minecraft.world.item.enchantment.EnchantmentHelper#getEnchantmentsForCrafting(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:76 - Modifiers:
public static - Return:
ItemEnchantments
คืออะไร
อ่านค่า Enchantments For Crafting
ทำงานยังไง
เรียกต่อ: getOrDefault(), getComponentType(). คืนค่า: itemStack.getOrDefault(getComponentType(itemStack), ItemEnchantments.EMPTY).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemEnchantments result = EnchantmentHelper.getEnchantmentsForCrafting(itemStack);
net.minecraft.world.item.enchantment.EnchantmentHelper#getFishingLuckBonus(ServerLevel,ItemStack,Entity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:388 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Fishing Luck Bonus
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyFishingLuckBonus(), max(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0, mutableFloat.intValue()).
Parameters
ServerLevel serverLevelItemStack itemStackEntity entity
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
int result = EnchantmentHelper.getFishingLuckBonus(serverLevel, itemStack, entity);
net.minecraft.world.item.enchantment.EnchantmentHelper#getFishingTimeReduction(ServerLevel,ItemStack,Entity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:394 - Modifiers:
public static - Return:
float
คืออะไร
อ่านค่า Fishing Time Reduction
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyFishingTimeReduction(), max(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0.0F, mutableFloat.floatValue()).
Parameters
ServerLevel serverLevelItemStack itemStackEntity entity
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
float result = EnchantmentHelper.getFishingTimeReduction(serverLevel, itemStack, entity);
net.minecraft.world.item.enchantment.EnchantmentHelper#getHighestLevel(ItemStack,DataComponentType<T>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:452 - Modifiers:
public static - Return:
Pair<T, Integer>
คืออะไร
อ่านค่า Highest Level
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnItem(), getValue(), getSecond(), value(), effects(), get(), setValue(), of(). สร้างออบเจ็กต์: MutableObject<>. คืนค่า: mutableObject.getValue().
Parameters
ItemStack itemStackDataComponentType<T> dataComponentType
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
DataComponentType<T> dataComponentType = ...;
Pair<T, Integer> result = EnchantmentHelper.getHighestLevel(itemStack, dataComponentType);
net.minecraft.world.item.enchantment.EnchantmentHelper#getItemEnchantmentLevel(Holder<Enchantment>,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:49 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Item Enchantment Level
ทำงานยังไง
เรียกต่อ: getOrDefault(), getLevel(). คืนค่า: itemEnchantments.getLevel(holder).
Parameters
Holder<Enchantment> holderItemStack itemStack
ตัวอย่างใช้งาน
Holder<Enchantment> holder = ...;
ItemStack itemStack = ...;
int result = EnchantmentHelper.getItemEnchantmentLevel(holder, itemStack);
net.minecraft.world.item.enchantment.EnchantmentHelper#getPiercingCount(ServerLevel,ItemStack,ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:297 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Piercing Count
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyPiercingCount(), max(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0, mutableFloat.intValue()).
Parameters
ServerLevel serverLevelItemStack itemStackItemStack itemStack2
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
int result = EnchantmentHelper.getPiercingCount(serverLevel, itemStack, itemStack2);
net.minecraft.world.item.enchantment.EnchantmentHelper#getRandomItemWith(DataComponentType<?>,LivingEntity,Predicate<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:466 - Modifiers:
public static - Return:
Optional<EnchantedItemInUse>
คืออะไร
อ่านค่า Random Item With
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getItemBySlot(), test(), getOrDefault(), entrySet(), getKey(), value(), effects(), has(). สร้างออบเจ็กต์: ArrayList<>, EnchantedItemInUse. คืนค่า: Util.getRandomSafe(list, livingEntity.getRandom()).
Parameters
DataComponentType<?> dataComponentTypeLivingEntity livingEntityPredicate<ItemStack> predicate
ตัวอย่างใช้งาน
DataComponentType<?> dataComponentType = ...;
LivingEntity livingEntity = ...;
Predicate<ItemStack> predicate = ...;
Optional<EnchantedItemInUse> result = EnchantmentHelper.getRandomItemWith(dataComponentType, livingEntity, predicate);
net.minecraft.world.item.enchantment.EnchantmentHelper#getTridentReturnToOwnerAcceleration(ServerLevel,ItemStack,Entity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:400 - Modifiers:
public static - Return:
int
คืออะไร
อ่านค่า Trident Return To Owner Acceleration
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyTridentReturnToOwnerAcceleration(), max(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0, mutableFloat.intValue()).
Parameters
ServerLevel serverLevelItemStack itemStackEntity entity
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
int result = EnchantmentHelper.getTridentReturnToOwnerAcceleration(serverLevel, itemStack, entity);
net.minecraft.world.item.enchantment.EnchantmentHelper#getTridentSpinAttackStrength(ItemStack,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:412 - Modifiers:
public static - Return:
float
คืออะไร
อ่านค่า Trident Spin Attack Strength
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyTridentSpinAttackStrength(), getRandom(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ItemStack itemStackLivingEntity livingEntity
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
float result = EnchantmentHelper.getTridentSpinAttackStrength(itemStack, livingEntity);
net.minecraft.world.item.enchantment.EnchantmentHelper#has(ItemStack,DataComponentType<?>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:431 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่ามี has
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnItem(), value(), effects(), setTrue(), booleanValue(). สร้างออบเจ็กต์: MutableBoolean. คืนค่า: mutableBoolean.booleanValue().
Parameters
ItemStack itemStackDataComponentType<?> dataComponentType
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
DataComponentType<?> dataComponentType = ...;
boolean result = EnchantmentHelper.has(itemStack, dataComponentType);
net.minecraft.world.item.enchantment.EnchantmentHelper#hasAnyEnchantments(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:84 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Any Enchantments
ทำงานยังไง
เรียกต่อ: getOrDefault(), isEmpty().
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.EnchantmentHelper#hasTag(ItemStack,TagKey<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:418 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Tag
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getOrDefault(), entrySet(), getKey(), is(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackTagKey<Enchantment> tagKey
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
TagKey<Enchantment> tagKey = ...;
boolean result = EnchantmentHelper.hasTag(itemStack, tagKey);
net.minecraft.world.item.enchantment.EnchantmentHelper#isEnchantmentCompatible(Collection<Holder<Enchantment>>,Holder<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:564 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Enchantment Compatible
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: areCompatible(). มีจุด return อย่างน้อย 2 จุด.
Parameters
Collection<Holder<Enchantment>> collectionHolder<Enchantment> holder
ตัวอย่างใช้งาน
Collection<Holder<Enchantment>> collection = ...;
Holder<Enchantment> holder = ...;
boolean result = EnchantmentHelper.isEnchantmentCompatible(collection, holder);
net.minecraft.world.item.enchantment.EnchantmentHelper#isImmuneToDamage(ServerLevel,LivingEntity,DamageSource)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:158 - Modifiers:
public static - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Immune To Damage
ทำงานยังไง
เรียกต่อ: runIterationOnEquipment(), setValue(), isTrue(), value(). สร้างออบเจ็กต์: MutableBoolean. คืนค่า: mutableBoolean.isTrue().
Parameters
ServerLevel serverLevelLivingEntity livingEntityDamageSource damageSource
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
DamageSource damageSource = ...;
boolean result = EnchantmentHelper.isImmuneToDamage(serverLevel, livingEntity, damageSource);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyArmorEffectiveness(ServerLevel,ItemStack,Entity,DamageSource,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:191 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ modifyArmorEffectiveness ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyArmorEffectivness(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityDamageSource damageSourcefloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.modifyArmorEffectiveness(serverLevel, itemStack, entity, damageSource, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyCrossbowChargingTime(ItemStack,LivingEntity,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:406 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ modifyCrossbowChargingTime ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyCrossbowChargeTime(), getRandom(), max(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0.0F, mutableFloat.floatValue()).
Parameters
ItemStack itemStackLivingEntity livingEntityfloat f
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
float result = EnchantmentHelper.modifyCrossbowChargingTime(itemStack, livingEntity, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyDamage(ServerLevel,ItemStack,Entity,DamageSource,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:179 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ modifyDamage ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityDamageSource damageSourcefloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.modifyDamage(serverLevel, itemStack, entity, damageSource, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyDurabilityToRepairFromXp(ServerLevel,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:323 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ modifyDurabilityToRepairFromXp ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), max(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0, mutableFloat.intValue()).
Parameters
ServerLevel serverLevelItemStack itemStackint i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
int result = EnchantmentHelper.modifyDurabilityToRepairFromXp(serverLevel, itemStack, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyFallBasedDamage(ServerLevel,ItemStack,Entity,DamageSource,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:185 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ modifyFallBasedDamage ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityDamageSource damageSourcefloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.modifyFallBasedDamage(serverLevel, itemStack, entity, damageSource, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#modifyKnockback(ServerLevel,ItemStack,Entity,DamageSource,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:197 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ modifyKnockback ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityDamageSource damageSourcefloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.modifyKnockback(serverLevel, itemStack, entity, damageSource, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#onHitBlock(ServerLevel,ItemStack,LivingEntity,Entity,EquipmentSlot,Vec3,BlockState,Consumer<Item>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:309 - Modifiers:
public static - Return:
void
คืออะไร
จัดการเหตุการณ์ Hit Block
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(). สร้างออบเจ็กต์: EnchantedItemInUse.
Parameters
ServerLevel serverLevelItemStack itemStackLivingEntity livingEntityEntity entityEquipmentSlot equipmentSlotVec3 vec3BlockState blockStateConsumer<Item> consumer
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
Entity entity = ...;
EquipmentSlot equipmentSlot = ...;
Vec3 vec3 = ...;
BlockState blockState = ...;
Consumer<Item> consumer = ...;
EnchantmentHelper.onHitBlock(serverLevel, itemStack, livingEntity, entity, equipmentSlot, vec3, blockState, consumer);
net.minecraft.world.item.enchantment.EnchantmentHelper#onProjectileSpawned(ServerLevel,ItemStack,Projectile,Consumer<Item>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:303 - Modifiers:
public static - Return:
void
คืออะไร
จัดการเหตุการณ์ Projectile Spawned
ทำงานยังไง
เรียกต่อ: getOwner(), runIterationOnItem(), value(). สร้างออบเจ็กต์: EnchantedItemInUse.
Parameters
ServerLevel serverLevelItemStack itemStackProjectile projectileConsumer<Item> consumer
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Projectile projectile = ...;
Consumer<Item> consumer = ...;
EnchantmentHelper.onProjectileSpawned(serverLevel, itemStack, projectile, consumer);
net.minecraft.world.item.enchantment.EnchantmentHelper#pickHighestLevel(ItemStack,DataComponentType<List<T>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:441 - Modifiers:
public static - Return:
Optional<T>
คืออะไร
ดำเนินการ pickHighestLevel ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getHighestLevel(), getFirst(), getSecond(), of(), get(), min(), size(), empty(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackDataComponentType<List<T>> dataComponentType
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
DataComponentType<List<T>> dataComponentType = ...;
Optional<T> result = EnchantmentHelper.pickHighestLevel(itemStack, dataComponentType);
net.minecraft.world.item.enchantment.EnchantmentHelper#processAmmoUse(ServerLevel,ItemStack,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:95 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ processAmmoUse ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyAmmoCount(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.intValue().
Parameters
ServerLevel serverLevelItemStack itemStackItemStack itemStack2int i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
ItemStack itemStack2 = ...;
int result = EnchantmentHelper.processAmmoUse(serverLevel, itemStack, itemStack2, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#processBlockExperience(ServerLevel,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:101 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ processBlockExperience ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyBlockExperience(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.intValue().
Parameters
ServerLevel serverLevelItemStack itemStackint i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
int result = EnchantmentHelper.processBlockExperience(serverLevel, itemStack, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#processDurabilityChange(ServerLevel,ItemStack,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:89 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ processDurabilityChange ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyDurabilityChange(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.intValue().
Parameters
ServerLevel serverLevelItemStack itemStackint i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
int result = EnchantmentHelper.processDurabilityChange(serverLevel, itemStack, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#processEquipmentDropChance(ServerLevel,LivingEntity,DamageSource,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:329 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ processEquipmentDropChance ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getRandom(), runIterationOnEquipment(), damageContext(), value(), getEffects(), forEach(), enchanted(), affected(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: mutableFloat.floatValue().
Parameters
ServerLevel serverLevelLivingEntity livingEntityDamageSource damageSourcefloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
DamageSource damageSource = ...;
float result = EnchantmentHelper.processEquipmentDropChance(serverLevel, livingEntity, damageSource, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#processMobExperience(ServerLevel,Entity,Entity,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:107 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ processMobExperience ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: runIterationOnEquipment(), value(), modifyMobExperience(), itemStack(), intValue(). สร้างออบเจ็กต์: MutableFloat. มีจุด return อย่างน้อย 2 จุด.
Parameters
ServerLevel serverLevelEntity entityEntity entity2int i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Entity entity = ...;
Entity entity2 = ...;
int result = EnchantmentHelper.processMobExperience(serverLevel, entity, entity2, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#processProjectileCount(ServerLevel,ItemStack,Entity,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:285 - Modifiers:
public static - Return:
int
คืออะไร
ดำเนินการ processProjectileCount ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyProjectileCount(), max(), intValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0, mutableFloat.intValue()).
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityint i
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
int result = EnchantmentHelper.processProjectileCount(serverLevel, itemStack, entity, 0);
net.minecraft.world.item.enchantment.EnchantmentHelper#processProjectileSpread(ServerLevel,ItemStack,Entity,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:291 - Modifiers:
public static - Return:
float
คืออะไร
ดำเนินการ processProjectileSpread ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value(), modifyProjectileSpread(), max(), floatValue(). สร้างออบเจ็กต์: MutableFloat. คืนค่า: Math.max(0.0F, mutableFloat.floatValue()).
Parameters
ServerLevel serverLevelItemStack itemStackEntity entityfloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
Entity entity = ...;
float result = EnchantmentHelper.processProjectileSpread(serverLevel, itemStack, entity, 0.0F);
net.minecraft.world.item.enchantment.EnchantmentHelper#runLocationChangedEffects(ServerLevel,ItemStack,LivingEntity,EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:248 - Modifiers:
public static - Return:
void
คืออะไร
สั่งทำงาน Location Changed Effects
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value().
Parameters
ServerLevel serverLevelItemStack itemStackLivingEntity livingEntityEquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
EquipmentSlot equipmentSlot = ...;
EnchantmentHelper.runLocationChangedEffects(serverLevel, itemStack, livingEntity, equipmentSlot);
net.minecraft.world.item.enchantment.EnchantmentHelper#runLocationChangedEffects(ServerLevel,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:242 - Modifiers:
public static - Return:
void
คืออะไร
สั่งทำงาน Location Changed Effects
ทำงานยังไง
เรียกต่อ: runIterationOnEquipment(), value().
Parameters
ServerLevel serverLevelLivingEntity livingEntity
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
EnchantmentHelper.runLocationChangedEffects(serverLevel, livingEntity);
net.minecraft.world.item.enchantment.EnchantmentHelper#selectEnchantment(RandomSource,ItemStack,int,Stream<Holder<Enchantment>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:529 - Modifiers:
public static - Return:
List<EnchantmentInstance>
คืออะไร
ดำเนินการ selectEnchantment ตาม implementation ของ EnchantmentHelper
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newArrayList(), get(), nextInt(), value(), nextFloat(), clamp(), round(), getAvailableEnchantmentResults(). มีจุด return อย่างน้อย 2 จุด.
Parameters
RandomSource randomSourceItemStack itemStackint iStream<Holder<Enchantment>> stream
ตัวอย่างใช้งาน
RandomSource randomSource = ...;
ItemStack itemStack = ...;
Stream<Holder<Enchantment>> stream = ...;
List<EnchantmentInstance> result = EnchantmentHelper.selectEnchantment(randomSource, itemStack, 0, stream);
net.minecraft.world.item.enchantment.EnchantmentHelper#setEnchantments(ItemStack,ItemEnchantments)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:72 - Modifiers:
public static - Return:
void
คืออะไร
กำหนดค่า Enchantments
ทำงานยังไง
เรียกต่อ: set(), getComponentType().
Parameters
ItemStack itemStackItemEnchantments itemEnchantments
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
ItemEnchantments itemEnchantments = ...;
EnchantmentHelper.setEnchantments(itemStack, itemEnchantments);
net.minecraft.world.item.enchantment.EnchantmentHelper#stopLocationBasedEffects(ItemStack,LivingEntity,EquipmentSlot)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:261 - Modifiers:
public static - Return:
void
คืออะไร
หยุด Location Based Effects
ทำงานยังไง
เรียกต่อ: runIterationOnItem(), value().
Parameters
ItemStack itemStackLivingEntity livingEntityEquipmentSlot equipmentSlot
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
LivingEntity livingEntity = ...;
EquipmentSlot equipmentSlot = ...;
EnchantmentHelper.stopLocationBasedEffects(itemStack, livingEntity, equipmentSlot);
net.minecraft.world.item.enchantment.EnchantmentHelper#stopLocationBasedEffects(LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:257 - Modifiers:
public static - Return:
void
คืออะไร
หยุด Location Based Effects
ทำงานยังไง
เรียกต่อ: runIterationOnEquipment(), value().
Parameters
LivingEntity livingEntity
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.EnchantmentHelper#tickEffects(ServerLevel,LivingEntity)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:267 - Modifiers:
public static - Return:
void
คืออะไร
ประมวลผล tick Effects
ทำงานยังไง
เรียกต่อ: runIterationOnEquipment(), value(), tick().
Parameters
ServerLevel serverLevelLivingEntity livingEntity
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
LivingEntity livingEntity = ...;
EnchantmentHelper.tickEffects(serverLevel, livingEntity);
net.minecraft.world.item.enchantment.EnchantmentHelper#updateEnchantments(ItemStack,Consumer<ItemEnchantments.Mutable>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentHelper.java:54 - Modifiers:
public static - Return:
ItemEnchantments
คืออะไร
อัปเดต Enchantments
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getComponentType(), get(), Mutable(), accept(), toImmutable(), set(). สร้างออบเจ็กต์: ItemEnchantments.Mutable. มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackConsumer<ItemEnchantments.Mutable> consumer
ตัวอย่างใช้งาน
ItemStack itemStack = ...;
Consumer<ItemEnchantments.Mutable> consumer = ...;
ItemEnchantments result = EnchantmentHelper.updateEnchantments(itemStack, consumer);
EnchantmentInstance
- Full name:
net.minecraft.world.item.enchantment.EnchantmentInstance - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/EnchantmentInstance.java - Type:
class - Modifiers:
public - Extends:
WeightedEntry.IntrusiveBase
net.minecraft.world.item.enchantment.EnchantmentInstance#EnchantmentInstance(Holder<Enchantment>,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentInstance.java:10 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ EnchantmentInstance ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: enchantment, level. เรียกต่อ: value(), getWeight().
Parameters
Holder<Enchantment> holderint i
ตัวอย่างใช้งาน
Holder<Enchantment> holder = ...;
EnchantmentInstance instance = new EnchantmentInstance(holder, 0);
Enchantments
- Full name:
net.minecraft.world.item.enchantment.Enchantments - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Enchantments.java - Type:
class - Modifiers:
public
net.minecraft.world.item.enchantment.Enchantments#bootstrap(BootstrapContext<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Enchantments.java:123 - Modifiers:
public static - Return:
void
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ Enchantments
ทำงานยังไง
เรียกต่อ: lookup(), register(), enchantment(), definition(), getOrThrow(), dynamicCost(), exclusiveWith(), withEffect(). สร้างออบเจ็กต์: AddValue, EnchantmentAttributeEffect, DamageEntity, ChangeItemDamage.
Parameters
BootstrapContext<Enchantment> bootstrapContext
ตัวอย่างใช้งาน
EnchantmentTarget
- Full name:
net.minecraft.world.item.enchantment.EnchantmentTarget - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/EnchantmentTarget.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.item.enchantment.EnchantmentTarget#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/EnchantmentTarget.java:18 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.id.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ItemEnchantments
- Full name:
net.minecraft.world.item.enchantment.ItemEnchantments - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/ItemEnchantments.java - Type:
class - Modifiers:
public - Implements:
TooltipProvider
net.minecraft.world.item.enchantment.ItemEnchantments#addToTooltip(Item.TooltipContext,Consumer<Component>,TooltipFlag)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:71 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม To Tooltip
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: registries(), getTagOrEmpty(), getInt(), accept(), getFullname(), object2IntEntrySet(), getKey(), contains().
Parameters
Item.TooltipContext tooltipContextConsumer<Component> consumerTooltipFlag tooltipFlag
ตัวอย่างใช้งาน
ItemEnchantments instance = ...;
Item.TooltipContext tooltipContext = ...;
Consumer<Component> consumer = ...;
TooltipFlag tooltipFlag = ...;
instance.addToTooltip(tooltipContext, consumer, tooltipFlag);
net.minecraft.world.item.enchantment.ItemEnchantments#entrySet()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:112 - Modifiers:
public - Return:
Set<Entry<Holder<Enchantment>>>
คืออะไร
ดำเนินการ entrySet ตาม implementation ของ ItemEnchantments
ทำงานยังไง
เรียกต่อ: unmodifiableSet(), object2IntEntrySet(). คืนค่า: Collections.unmodifiableSet(this.enchantments.object2IntEntrySet()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#equals(Object)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:124 - Modifiers:
public - Return:
boolean
คืออะไร
เปรียบเทียบความเท่ากัน equals
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: showInTooltip. คืนค่า: true.
Parameters
Object object
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#getLevel(Holder<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:67 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Level
ทำงานยังไง
เรียกต่อ: getInt(). คืนค่า: this.enchantments.getInt(holder).
Parameters
Holder<Enchantment> holder
ตัวอย่างใช้งาน
ItemEnchantments instance = ...;
Holder<Enchantment> holder = ...;
int result = instance.getLevel(holder);
net.minecraft.world.item.enchantment.ItemEnchantments#hashCode()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:135 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ hashCode ตาม implementation ของ ItemEnchantments
ทำงานยังไง
คืนค่า: 31 * i + (this.showInTooltip ? 1 : 0).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#isEmpty()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:120 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.enchantments.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#keySet()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:108 - Modifiers:
public - Return:
Set<Holder<Enchantment>>
คืออะไร
ดำเนินการ keySet ตาม implementation ของ ItemEnchantments
ทำงานยังไง
เรียกต่อ: unmodifiableSet(). คืนค่า: Collections.unmodifiableSet(this.enchantments.keySet()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#size()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:116 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ size ตาม implementation ของ ItemEnchantments
ทำงานยังไง
คืนค่า: this.enchantments.size().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#toString()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:141 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ ItemEnchantments
ทำงานยังไง
คืนค่า: "ItemEnchantments{enchantments=" + this.enchantments + ", showInTooltip=" + this.showInTooltip + "}".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments#withTooltip(boolean)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:104 - Modifiers:
public - Return:
ItemEnchantments
คืออะไร
ดำเนินการ withTooltip ตาม implementation ของ ItemEnchantments
ทำงานยังไง
สร้างออบเจ็กต์: ItemEnchantments. คืนค่า: new ItemEnchantments(this.enchantments, bl).
Parameters
boolean bl
ตัวอย่างใช้งาน
ItemEnchantments$Mutable
- Full name:
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/ItemEnchantments.java - Type:
class - Modifiers:
public static
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#getLevel(Holder<Enchantment>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:173 - Modifiers:
public - Return:
int
คืออะไร
อ่านค่า Level
ทำงานยังไง
เรียกต่อ: getOrDefault(). คืนค่า: this.enchantments.getOrDefault(holder, 0).
Parameters
Holder<Enchantment> holder
ตัวอย่างใช้งาน
ItemEnchantments.Mutable instance = ...;
Holder<Enchantment> holder = ...;
int result = instance.getLevel(holder);
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#keySet()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:177 - Modifiers:
public - Return:
Set<Holder<Enchantment>>
คืออะไร
ดำเนินการ keySet ตาม implementation ของ ItemEnchantments$Mutable
ทำงานยังไง
คืนค่า: this.enchantments.keySet().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#Mutable(ItemEnchantments)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:150 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ItemEnchantments.Mutable ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: showInTooltip. เรียกต่อ: putAll().
Parameters
ItemEnchantments itemEnchantments
ตัวอย่างใช้งาน
ItemEnchantments itemEnchantments = ...;
ItemEnchantments.Mutable instance = new ItemEnchantments.Mutable(itemEnchantments);
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#removeIf(Predicate<Holder<Enchantment>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:169 - Modifiers:
public - Return:
void
คืออะไร
ลบ If
ทำงานยังไง
เรียกต่อ: keySet().
Parameters
Predicate<Holder<Enchantment>> predicate
ตัวอย่างใช้งาน
ItemEnchantments.Mutable instance = ...;
Predicate<Holder<Enchantment>> predicate = ...;
instance.removeIf(predicate);
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#set(Holder<Enchantment>,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:155 - Modifiers:
public - Return:
void
คืออะไร
กำหนดค่า set
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: removeInt(), put(), min().
Parameters
Holder<Enchantment> holderint i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#toImmutable()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:181 - Modifiers:
public - Return:
ItemEnchantments
คืออะไร
ดำเนินการ toImmutable ตาม implementation ของ ItemEnchantments$Mutable
ทำงานยังไง
สร้างออบเจ็กต์: ItemEnchantments. คืนค่า: new ItemEnchantments(this.enchantments, this.showInTooltip).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.ItemEnchantments$Mutable#upgrade(Holder<Enchantment>,int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/ItemEnchantments.java:163 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ upgrade ตาม implementation ของ ItemEnchantments$Mutable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: merge(), min().
Parameters
Holder<Enchantment> holderint i
ตัวอย่างใช้งาน
ItemEnchantments.Mutable instance = ...;
Holder<Enchantment> holder = ...;
instance.upgrade(holder, 0);
LevelBasedValue
- Full name:
net.minecraft.world.item.enchantment.LevelBasedValue - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/LevelBasedValue.java - Type:
interface - Modifiers:
public
net.minecraft.world.item.enchantment.LevelBasedValue#bootstrap(Registry<MapCodec<? extends LevelBasedValue>>)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:23 - Modifiers:
static - Return:
MapCodec<? extends LevelBasedValue>
คืออะไร
ดำเนินการ bootstrap ตาม implementation ของ LevelBasedValue
ทำงานยังไง
เรียกต่อ: register(). คืนค่า: Registry.register(registry, "lookup", LevelBasedValue.Lookup.CODEC).
Parameters
Registry<MapCodec<? extends LevelBasedValue>> registry
ตัวอย่างใช้งาน
Registry<MapCodec<? extends LevelBasedValue>> registry = ...;
MapCodec<? extends LevelBasedValue> result = LevelBasedValue.bootstrap(registry);
net.minecraft.world.item.enchantment.LevelBasedValue#calculate(int)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:47 - Modifiers: ``
- Return:
float
คืออะไร
คำนวณ calculate
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.LevelBasedValue#codec()
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:49 - Modifiers: ``
- Return:
MapCodec<? extends LevelBasedValue>
คืออะไร
ดำเนินการ codec ตาม implementation ของ LevelBasedValue
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.LevelBasedValue#constant(float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:31 - Modifiers:
static - Return:
LevelBasedValue.Constant
คืออะไร
ดำเนินการ constant ตาม implementation ของ LevelBasedValue
ทำงานยังไง
เรียกต่อ: Constant(). สร้างออบเจ็กต์: LevelBasedValue.Constant. คืนค่า: new LevelBasedValue.Constant(f).
Parameters
float f
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.LevelBasedValue#lookup(List<Float>,LevelBasedValue)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:43 - Modifiers:
static - Return:
LevelBasedValue.Lookup
คืออะไร
ดำเนินการ lookup ตาม implementation ของ LevelBasedValue
ทำงานยังไง
เรียกต่อ: Lookup(). สร้างออบเจ็กต์: LevelBasedValue.Lookup. คืนค่า: new LevelBasedValue.Lookup(list, levelBasedValue).
Parameters
List<Float> listLevelBasedValue levelBasedValue
ตัวอย่างใช้งาน
List<Float> list = ...;
LevelBasedValue levelBasedValue = ...;
LevelBasedValue.Lookup result = LevelBasedValue.lookup(list, levelBasedValue);
net.minecraft.world.item.enchantment.LevelBasedValue#perLevel(float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:39 - Modifiers:
static - Return:
LevelBasedValue.Linear
คืออะไร
ดำเนินการ perLevel ตาม implementation ของ LevelBasedValue
ทำงานยังไง
คืนค่า: perLevel(f, f).
Parameters
float f
ตัวอย่างใช้งาน
net.minecraft.world.item.enchantment.LevelBasedValue#perLevel(float,float)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/LevelBasedValue.java:35 - Modifiers:
static - Return:
LevelBasedValue.Linear
คืออะไร
ดำเนินการ perLevel ตาม implementation ของ LevelBasedValue
ทำงานยังไง
เรียกต่อ: Linear(). สร้างออบเจ็กต์: LevelBasedValue.Linear. คืนค่า: new LevelBasedValue.Linear(f, g).
Parameters
float ffloat g
ตัวอย่างใช้งาน
Repairable
- Full name:
net.minecraft.world.item.enchantment.Repairable - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/Repairable.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.Repairable#isValidRepairItem(ItemStack)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/Repairable.java:22 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Valid Repair Item
ทำงานยังไง
เรียกต่อ: is(). คืนค่า: itemStack.is(this.items).
Parameters
ItemStack itemStack
ตัวอย่างใช้งาน
Repairable instance = ...;
ItemStack itemStack = ...;
boolean result = instance.isValidRepairItem(itemStack);
TargetedConditionalEffect
- Full name:
net.minecraft.world.item.enchantment.TargetedConditionalEffect - Package:
net.minecraft.world.item.enchantment - Source:
common—net/minecraft/world/item/enchantment/TargetedConditionalEffect.java - Type:
record - Modifiers:
public
net.minecraft.world.item.enchantment.TargetedConditionalEffect#codec(Codec<S>,ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/TargetedConditionalEffect.java:14 - Modifiers:
public static - Return:
Codec<TargetedConditionalEffect<S>>
คืออะไร
ดำเนินการ codec ตาม implementation ของ TargetedConditionalEffect
ทำงานยังไง
เรียกต่อ: create(), group(), fieldOf(), forGetter(), conditionCodec(), optionalFieldOf(), apply().
Parameters
Codec<S> codecContextKeySet contextKeySet
ตัวอย่างใช้งาน
Codec<S> codec = ...;
ContextKeySet contextKeySet = ...;
Codec<TargetedConditionalEffect<S>> result = TargetedConditionalEffect.codec(codec, contextKeySet);
net.minecraft.world.item.enchantment.TargetedConditionalEffect#equipmentDropsCodec(Codec<S>,ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/TargetedConditionalEffect.java:28 - Modifiers:
public static - Return:
Codec<TargetedConditionalEffect<S>>
คืออะไร
ดำเนินการ equipmentDropsCodec ตาม implementation ของ TargetedConditionalEffect
ทำงานยังไง
เรียกต่อ: create(), group(), validate(), success(), error(), fieldOf(), forGetter(), conditionCodec(). สร้างออบเจ็กต์: TargetedConditionalEffect<>.
Parameters
Codec<S> codecContextKeySet contextKeySet
ตัวอย่างใช้งาน
Codec<S> codec = ...;
ContextKeySet contextKeySet = ...;
Codec<TargetedConditionalEffect<S>> result = TargetedConditionalEffect.equipmentDropsCodec(codec, contextKeySet);
net.minecraft.world.item.enchantment.TargetedConditionalEffect#matches(LootContext)
- Origin:
common - Source:
net/minecraft/world/item/enchantment/TargetedConditionalEffect.java:46 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ matches ตาม implementation ของ TargetedConditionalEffect
ทำงานยังไง
เรียกต่อ: isEmpty(), get(), test(). คืนค่า: this.requirements.isEmpty() ? true : this.requirements.get().test(lootContext).
Parameters
LootContext lootContext
ตัวอย่างใช้งาน
TargetedConditionalEffect instance = ...;
LootContext lootContext = ...;
boolean result = instance.matches(lootContext);