Record Class MobEffectEntityReward
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.entity.MobEffectEntityReward
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IEntityReward,IAbstractReward<IEntityReward.Type>
@ParametersAreNonnullByDefault
public record MobEffectEntityReward(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, net.minecraft.world.level.storage.loot.providers.number.NumberProvider duration, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amplifier, boolean showParticles)
extends Record
implements IEntityReward
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.entity.IEntityReward
IEntityReward.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<MobEffectEntityReward> Fields inherited from interface petrolpark.mc.library.core.data.reward.entity.IEntityReward
DIRECT_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionMobEffectEntityReward(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, net.minecraft.world.level.storage.loot.providers.number.NumberProvider duration, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amplifier, boolean showParticles) Creates an instance of aMobEffectEntityRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of theamplifierrecord component.net.minecraft.world.level.storage.loot.providers.number.NumberProviderduration()Returns the value of thedurationrecord component.net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect()Returns the value of theeffectrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.info()booleanreward(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) booleanReturns the value of theshowParticlesrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
MobEffectEntityReward
public MobEffectEntityReward(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, net.minecraft.world.level.storage.loot.providers.number.NumberProvider duration, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amplifier, boolean showParticles) Creates an instance of aMobEffectEntityRewardrecord class.- Parameters:
effect- the value for theeffectrecord componentduration- the value for thedurationrecord componentamplifier- the value for theamplifierrecord componentshowParticles- the value for theshowParticlesrecord component
-
-
Method Details
-
reward
public boolean reward(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) - Specified by:
rewardin interfaceIEntityReward
-
info
- Specified by:
infoin interfaceIAbstractReward<IEntityReward.Type>
-
getType
- Specified by:
getTypein interfaceIAbstractReward<IEntityReward.Type>
-
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 '=='. -
effect
public net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect()Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
duration
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
amplifier
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider amplifier()Returns the value of theamplifierrecord component.- Returns:
- the value of the
amplifierrecord component
-
showParticles
public boolean showParticles()Returns the value of theshowParticlesrecord component.- Returns:
- the value of the
showParticlesrecord component
-