Package net.minecraft.component.type
Record Class BlocksAttacksComponent
java.lang.Object
java.lang.Record
net.minecraft.component.type.BlocksAttacksComponent
- Record Components:
blockDelaySeconds-disableCooldownScale-damageReductions-itemDamage-bypassedBy-blockSound-disableSound-
public record BlocksAttacksComponent(float blockDelaySeconds, float disableCooldownScale, List<BlocksAttacksComponent.DamageReduction> damageReductions, BlocksAttacksComponent.ItemDamage itemDamage, Optional<TagKey<DamageType>> bypassedBy, Optional<RegistryEntry<SoundEvent>> blockSound, Optional<RegistryEntry<SoundEvent>> disableSound)
extends Record
- Mappings:
Namespace Name named net/minecraft/component/type/BlocksAttacksComponentintermediary net/minecraft/class_10707official dclnamed blockDelaySecondsintermediary comp_3586official cnamed disableCooldownScaleintermediary comp_3587official dnamed damageReductionsintermediary comp_3588official enamed itemDamageintermediary comp_3589official fnamed bypassedByintermediary comp_3637official gnamed blockSoundintermediary comp_3590official hnamed disableSoundintermediary comp_3591official i
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatThe field for theblockDelaySecondsrecord component.private final Optional<RegistryEntry<SoundEvent>> The field for theblockSoundrecord component.private final Optional<TagKey<DamageType>> The field for thebypassedByrecord component.static final com.mojang.serialization.Codec<BlocksAttacksComponent> private final List<BlocksAttacksComponent.DamageReduction> The field for thedamageReductionsrecord component.private final floatThe field for thedisableCooldownScalerecord component.private final Optional<RegistryEntry<SoundEvent>> The field for thedisableSoundrecord component.private final BlocksAttacksComponent.ItemDamageThe field for theitemDamagerecord component.static final PacketCodec<RegistryByteBuf, BlocksAttacksComponent> -
Constructor Summary
ConstructorsConstructorDescriptionBlocksAttacksComponent(float float2, float float3, List<BlocksAttacksComponent.DamageReduction> list, BlocksAttacksComponent.ItemDamage itemDamage, Optional<TagKey<DamageType>> optional, Optional<RegistryEntry<SoundEvent>> optional2, Optional<RegistryEntry<SoundEvent>> optional3) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyShieldCooldown(ServerWorld world, LivingEntity affectedEntity, float cooldownSeconds, ItemStack stack) floatReturns the value of theblockDelaySecondsrecord component.Returns the value of theblockSoundrecord component.Returns the value of thebypassedByrecord component.private intconvertCooldownToTicks(float cooldownSeconds) Returns the value of thedamageReductionsrecord component.floatReturns the value of thedisableCooldownScalerecord component.Returns the value of thedisableSoundrecord component.final booleanIndicates whether some other object is "equal to" this one.intfloatgetDamageReductionAmount(DamageSource source, float damage, double angle) final inthashCode()Returns a hash code value for this object.Returns the value of theitemDamagerecord component.voidonShieldHit(World world, ItemStack stack, LivingEntity entity, Hand hand, float itemDamage) voidplayBlockSound(ServerWorld world, LivingEntity from) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
blockDelaySeconds
private final float blockDelaySecondsThe field for theblockDelaySecondsrecord component. -
disableCooldownScale
private final float disableCooldownScaleThe field for thedisableCooldownScalerecord component. -
damageReductions
The field for thedamageReductionsrecord component. -
itemDamage
The field for theitemDamagerecord component. -
bypassedBy
The field for thebypassedByrecord component. -
blockSound
The field for theblockSoundrecord component. -
disableSound
The field for thedisableSoundrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/component/type/BlocksAttacksComponent;CODEC:Lcom/mojang/serialization/Codec;intermediary field_56301Lnet/minecraft/class_10707;field_56301:Lcom/mojang/serialization/Codec;official aLdcl;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/component/type/BlocksAttacksComponent;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_56302Lnet/minecraft/class_10707;field_56302:Lnet/minecraft/class_9139;official bLdcl;b:Lze;
-
-
Constructor Details
-
BlocksAttacksComponent
public BlocksAttacksComponent(float float2, float float3, List<BlocksAttacksComponent.DamageReduction> list, BlocksAttacksComponent.ItemDamage itemDamage, Optional<TagKey<DamageType>> optional, Optional<RegistryEntry<SoundEvent>> optional2, Optional<RegistryEntry<SoundEvent>> optional3)
-
-
Method Details
-
playBlockSound
- Mappings:
Namespace Name Mixin selector named playBlockSoundLnet/minecraft/component/type/BlocksAttacksComponent;playBlockSound(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;)Vintermediary method_67199Lnet/minecraft/class_10707;method_67199(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;)Vofficial aLdcl;a(Lasb;Lbyf;)V
-
applyShieldCooldown
public void applyShieldCooldown(ServerWorld world, LivingEntity affectedEntity, float cooldownSeconds, ItemStack stack) - Mappings:
Namespace Name Mixin selector named applyShieldCooldownLnet/minecraft/component/type/BlocksAttacksComponent;applyShieldCooldown(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/LivingEntity;FLnet/minecraft/item/ItemStack;)Vintermediary method_67200Lnet/minecraft/class_10707;method_67200(Lnet/minecraft/class_3218;Lnet/minecraft/class_1309;FLnet/minecraft/class_1799;)Vofficial aLdcl;a(Lasb;Lbyf;FLdak;)V
-
onShieldHit
public void onShieldHit(World world, ItemStack stack, LivingEntity entity, Hand hand, float itemDamage) - Mappings:
Namespace Name Mixin selector named onShieldHitLnet/minecraft/component/type/BlocksAttacksComponent;onShieldHit(Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/util/Hand;F)Vintermediary method_67204Lnet/minecraft/class_10707;method_67204(Lnet/minecraft/class_1937;Lnet/minecraft/class_1799;Lnet/minecraft/class_1309;Lnet/minecraft/class_1268;F)Vofficial aLdcl;a(Ldkj;Ldak;Lbyf;Lbvb;F)V
-
convertCooldownToTicks
private int convertCooldownToTicks(float cooldownSeconds) - Mappings:
Namespace Name Mixin selector named convertCooldownToTicksLnet/minecraft/component/type/BlocksAttacksComponent;convertCooldownToTicks(F)Iintermediary method_67198Lnet/minecraft/class_10707;method_67198(F)Iofficial aLdcl;a(F)I
-
getBlockDelayTicks
public int getBlockDelayTicks()- Mappings:
Namespace Name Mixin selector named getBlockDelayTicksLnet/minecraft/component/type/BlocksAttacksComponent;getBlockDelayTicks()Iintermediary method_67197Lnet/minecraft/class_10707;method_67197()Iofficial aLdcl;a()I
-
getDamageReductionAmount
- Mappings:
Namespace Name Mixin selector named getDamageReductionAmountLnet/minecraft/component/type/BlocksAttacksComponent;getDamageReductionAmount(Lnet/minecraft/entity/damage/DamageSource;FD)Fintermediary method_67202Lnet/minecraft/class_10707;method_67202(Lnet/minecraft/class_1282;FD)Fofficial aLdcl;a(Lbvt;FD)F
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
blockDelaySeconds
public float blockDelaySeconds()Returns the value of theblockDelaySecondsrecord component.- Returns:
- the value of the
blockDelaySecondsrecord component
-
disableCooldownScale
public float disableCooldownScale()Returns the value of thedisableCooldownScalerecord component.- Returns:
- the value of the
disableCooldownScalerecord component
-
damageReductions
Returns the value of thedamageReductionsrecord component.- Returns:
- the value of the
damageReductionsrecord component
-
itemDamage
Returns the value of theitemDamagerecord component.- Returns:
- the value of the
itemDamagerecord component
-
bypassedBy
Returns the value of thebypassedByrecord component.- Returns:
- the value of the
bypassedByrecord component
-
blockSound
Returns the value of theblockSoundrecord component.- Returns:
- the value of the
blockSoundrecord component
-
disableSound
Returns the value of thedisableSoundrecord component.- Returns:
- the value of the
disableSoundrecord component
-