Record Class EntityProperties
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.npc.entity.EntityProperties
- Record Components:
child- If the entity is a childinvulnerable- If the entity is invulnerableimmovable- If the entity is immovablepushable- If the entity is pushablenameplate- If the entity has a nameplatehealth- The health of the entitydimensions- The dimensions of the entity
public record EntityProperties(boolean child, boolean invulnerable, boolean immovable, boolean pushable, boolean nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon, net.minecraft.network.chat.Component title)
extends Record
An immutable record representing the properties of an
NPC.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEntityProperties(boolean child, boolean invulnerable, boolean immovable, boolean pushable, boolean nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon, net.minecraft.network.chat.Component title) Creates an instance of aEntityPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionasAdult()Creates a newEntityPropertieswith the child property set to false.asChild()Creates a newEntityPropertieswith the child property set to true.static EntityProperties.Builderbuilder()Creates a new builder for theEntityPropertiesrecord.booleanchild()Returns the value of thechildrecord component.static final EntityPropertiesstatic final EntityPropertiesnet.minecraft.world.entity.EntityDimensionsReturns the value of thedimensionsrecord component.final booleanIndicates whether some other object is "equal to" this one.floatReturns the value of theeyeHeightrecord component.final inthashCode()Returns a hash code value for this object.floathealth()Returns the value of thehealthrecord component.icon()Returns the value of theiconrecord component.booleanReturns the value of theimmovablerecord component.booleanReturns the value of theinvulnerablerecord component.Creates a newEntityPropertieswith the immovable property set to false.Creates a newEntityPropertieswith the invulnerable property set to true.Creates a newEntityPropertieswith the immovable property set to true.Creates a newEntityPropertieswith the invulnerable property set to false.booleanReturns the value of thenameplaterecord component.booleanpushable()Returns the value of thepushablerecord component.setChild(boolean child) Creates a newEntityPropertieswith the child property set to the given value.setImmovable(boolean immovable) Creates a newEntityPropertieswith the immovable property set to the given value.setInvulnerable(boolean invulnerable) Creates a newEntityPropertieswith the invulnerable property set to the given value.net.minecraft.network.chat.Componenttitle()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.withDimensions(net.minecraft.world.entity.EntityDimensions dimensions) Creates a newEntityPropertieswith the dimensions property set to the given value.withEyeHeight(double eyeHeight) Creates a newEntityPropertieswith the health property set to the given value.withEyeHeight(float eyeHeight) Creates a newEntityPropertieswith the health property set to the given value.withHealth(double health) Creates a newEntityPropertieswith the health property set to the given value.withHealth(float health) Creates a newEntityPropertieswith the health property set to the given value.withIcon(ResourceWithFallback icon) Creates a newEntityPropertieswith the icon property set to the given value.Creates a newEntityPropertieswith the nameplate property set to true.withNamePlate(boolean nameplate) Creates a newEntityPropertieswith the nameplate property set to the given value.Creates a newEntityPropertieswith the nameplate property set to false.withPushable(boolean pushable) Creates a newEntityPropertieswith the pushable property set to the provided value.withTitle(net.minecraft.network.chat.Component title)
-
Field Details
-
CODEC
-
-
Constructor Details
-
EntityProperties
public EntityProperties(boolean child, boolean invulnerable, boolean immovable, boolean pushable, boolean nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon, net.minecraft.network.chat.Component title) Creates an instance of aEntityPropertiesrecord class.- Parameters:
child- the value for thechildrecord componentinvulnerable- the value for theinvulnerablerecord componentimmovable- the value for theimmovablerecord componentpushable- the value for thepushablerecord componentnameplate- the value for thenameplaterecord componenthealth- the value for thehealthrecord componenteyeHeight- the value for theeyeHeightrecord componentdimensions- the value for thedimensionsrecord componenticon- the value for theiconrecord componenttitle- the value for thetitlerecord component
-
-
Method Details
-
defaultProperties
-
defaultChildProperties
-
asChild
Creates a newEntityPropertieswith the child property set to true.- Returns:
- The modified properties
-
asAdult
Creates a newEntityPropertieswith the child property set to false.- Returns:
- The modified properties
-
setChild
Creates a newEntityPropertieswith the child property set to the given value.- Parameters:
child- The new value- Returns:
- The modified properties
-
makeInvulnerable
Creates a newEntityPropertieswith the invulnerable property set to true.- Returns:
- The modified properties
-
makeVulnerable
Creates a newEntityPropertieswith the invulnerable property set to false.- Returns:
- The modified properties
-
setInvulnerable
Creates a newEntityPropertieswith the invulnerable property set to the given value.- Parameters:
invulnerable- The new value- Returns:
- The modified properties
-
makeMovable
Creates a newEntityPropertieswith the immovable property set to true.- Returns:
- The modified properties
-
makeImmovable
Creates a newEntityPropertieswith the immovable property set to false.- Returns:
- The modified properties
-
setImmovable
Creates a newEntityPropertieswith the immovable property set to the given value.- Parameters:
immovable- The new value- Returns:
- The modified properties
-
withHealth
Creates a newEntityPropertieswith the health property set to the given value.- Parameters:
health- The new value- Returns:
- The modified properties
-
withHealth
Creates a newEntityPropertieswith the health property set to the given value.- Parameters:
health- The new value- Returns:
- The modified properties
-
withEyeHeight
Creates a newEntityPropertieswith the health property set to the given value.- Parameters:
eyeHeight- The new value- Returns:
- The modified properties
-
withEyeHeight
Creates a newEntityPropertieswith the health property set to the given value.- Parameters:
eyeHeight- The new value- Returns:
- The modified properties
-
withDimensions
Creates a newEntityPropertieswith the dimensions property set to the given value.- Parameters:
dimensions- The new value- Returns:
- The modified properties
-
withNamePlate
Creates a newEntityPropertieswith the nameplate property set to true.- Returns:
- The modified properties
-
withoutNamePlate
Creates a newEntityPropertieswith the nameplate property set to false.- Returns:
- The modified properties
-
withNamePlate
Creates a newEntityPropertieswith the nameplate property set to the given value.- Parameters:
nameplate- The new value- Returns:
- The modified properties
-
withIcon
Creates a newEntityPropertieswith the icon property set to the given value.- Parameters:
icon- The new value- Returns:
- The modified properties
-
withPushable
Creates a newEntityPropertieswith the pushable property set to the provided value.- Returns:
- The modified properties
-
withTitle
-
builder
Creates a new builder for theEntityPropertiesrecord.- Returns:
- The new builder
-
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 '=='. -
child
public boolean child()Returns the value of thechildrecord component.- Returns:
- the value of the
childrecord component
-
invulnerable
public boolean invulnerable()Returns the value of theinvulnerablerecord component.- Returns:
- the value of the
invulnerablerecord component
-
immovable
public boolean immovable()Returns the value of theimmovablerecord component.- Returns:
- the value of the
immovablerecord component
-
pushable
public boolean pushable()Returns the value of thepushablerecord component.- Returns:
- the value of the
pushablerecord component
-
nameplate
public boolean nameplate()Returns the value of thenameplaterecord component.- Returns:
- the value of the
nameplaterecord component
-
health
public float health()Returns the value of thehealthrecord component.- Returns:
- the value of the
healthrecord component
-
eyeHeight
public float eyeHeight()Returns the value of theeyeHeightrecord component.- Returns:
- the value of the
eyeHeightrecord component
-
dimensions
public net.minecraft.world.entity.EntityDimensions dimensions()Returns the value of thedimensionsrecord component.- Returns:
- the value of the
dimensionsrecord component
-
icon
Returns the value of theiconrecord component.- Returns:
- the value of the
iconrecord component
-
title
public net.minecraft.network.chat.Component title()Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-