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 immovablenameplate
- 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 nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon)
extends Record
An immutable record representing the properties of an
NPC
.-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEntityProperties
(boolean child, boolean invulnerable, boolean immovable, boolean nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon) Creates an instance of aEntityProperties
record class. -
Method Summary
Modifier and TypeMethodDescriptionasAdult()
Creates a newEntityProperties
with the child property set to false.asChild()
Creates a newEntityProperties
with the child property set to true.static EntityProperties.Builder
builder()
Creates a new builder for theEntityProperties
record.boolean
child()
Returns the value of thechild
record component.static final EntityProperties
static final EntityProperties
net.minecraft.world.entity.EntityDimensions
Returns the value of thedimensions
record component.final boolean
Indicates whether some other object is "equal to" this one.float
Returns the value of theeyeHeight
record component.final int
hashCode()
Returns a hash code value for this object.float
health()
Returns the value of thehealth
record component.icon()
Returns the value of theicon
record component.boolean
Returns the value of theimmovable
record component.boolean
Returns the value of theinvulnerable
record component.Creates a newEntityProperties
with the immovable property set to false.Creates a newEntityProperties
with the invulnerable property set to true.Creates a newEntityProperties
with the immovable property set to true.Creates a newEntityProperties
with the invulnerable property set to false.boolean
Returns the value of thenameplate
record component.setChild
(boolean child) Creates a newEntityProperties
with the child property set to the given value.setImmovable
(boolean immovable) Creates a newEntityProperties
with the immovable property set to the given value.setInvulnerable
(boolean invulnerable) Creates a newEntityProperties
with the invulnerable property set to the given value.final String
toString()
Returns a string representation of this record class.withDimensions
(net.minecraft.world.entity.EntityDimensions dimensions) Creates a newEntityProperties
with the dimensions property set to the given value.withEyeHeight
(double eyeHeight) Creates a newEntityProperties
with the health property set to the given value.withEyeHeight
(float eyeHeight) Creates a newEntityProperties
with the health property set to the given value.withHealth
(double health) Creates a newEntityProperties
with the health property set to the given value.withHealth
(float health) Creates a newEntityProperties
with the health property set to the given value.withIcon
(ResourceWithFallback icon) Creates a newEntityProperties
with the icon property set to the given value.Creates a newEntityProperties
with the nameplate property set to true.withNamePlate
(boolean nameplate) Creates a newEntityProperties
with the nameplate property set to the given value.Creates a newEntityProperties
with the nameplate property set to false.
-
Field Details
-
CODEC
-
-
Constructor Details
-
EntityProperties
public EntityProperties(boolean child, boolean invulnerable, boolean immovable, boolean nameplate, float health, float eyeHeight, net.minecraft.world.entity.EntityDimensions dimensions, ResourceWithFallback icon) Creates an instance of aEntityProperties
record class.- Parameters:
child
- the value for thechild
record componentinvulnerable
- the value for theinvulnerable
record componentimmovable
- the value for theimmovable
record componentnameplate
- the value for thenameplate
record componenthealth
- the value for thehealth
record componenteyeHeight
- the value for theeyeHeight
record componentdimensions
- the value for thedimensions
record componenticon
- the value for theicon
record component
-
-
Method Details
-
defaultProperties
-
defaultChildProperties
-
asChild
Creates a newEntityProperties
with the child property set to true.- Returns:
- The modified properties
-
asAdult
Creates a newEntityProperties
with the child property set to false.- Returns:
- The modified properties
-
setChild
Creates a newEntityProperties
with the child property set to the given value.- Parameters:
child
- The new value- Returns:
- The modified properties
-
makeInvulnerable
Creates a newEntityProperties
with the invulnerable property set to true.- Returns:
- The modified properties
-
makeVulnerable
Creates a newEntityProperties
with the invulnerable property set to false.- Returns:
- The modified properties
-
setInvulnerable
Creates a newEntityProperties
with the invulnerable property set to the given value.- Parameters:
invulnerable
- The new value- Returns:
- The modified properties
-
makeMovable
Creates a newEntityProperties
with the immovable property set to true.- Returns:
- The modified properties
-
makeImmovable
Creates a newEntityProperties
with the immovable property set to false.- Returns:
- The modified properties
-
setImmovable
Creates a newEntityProperties
with the immovable property set to the given value.- Parameters:
immovable
- The new value- Returns:
- The modified properties
-
withHealth
Creates a newEntityProperties
with the health property set to the given value.- Parameters:
health
- The new value- Returns:
- The modified properties
-
withHealth
Creates a newEntityProperties
with the health property set to the given value.- Parameters:
health
- The new value- Returns:
- The modified properties
-
withEyeHeight
Creates a newEntityProperties
with the health property set to the given value.- Parameters:
eyeHeight
- The new value- Returns:
- The modified properties
-
withEyeHeight
Creates a newEntityProperties
with the health property set to the given value.- Parameters:
eyeHeight
- The new value- Returns:
- The modified properties
-
withDimensions
Creates a newEntityProperties
with the dimensions property set to the given value.- Parameters:
dimensions
- The new value- Returns:
- The modified properties
-
withNamePlate
Creates a newEntityProperties
with the nameplate property set to true.- Returns:
- The modified properties
-
withoutNamePlate
Creates a newEntityProperties
with the nameplate property set to false.- Returns:
- The modified properties
-
withNamePlate
Creates a newEntityProperties
with the nameplate property set to the given value.- Parameters:
nameplate
- The new value- Returns:
- The modified properties
-
withIcon
Creates a newEntityProperties
with the icon property set to the given value.- Parameters:
icon
- The new value- Returns:
- The modified properties
-
builder
Creates a new builder for theEntityProperties
record.- 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 thechild
record component.- Returns:
- the value of the
child
record component
-
invulnerable
public boolean invulnerable()Returns the value of theinvulnerable
record component.- Returns:
- the value of the
invulnerable
record component
-
immovable
public boolean immovable()Returns the value of theimmovable
record component.- Returns:
- the value of the
immovable
record component
-
nameplate
public boolean nameplate()Returns the value of thenameplate
record component.- Returns:
- the value of the
nameplate
record component
-
health
public float health()Returns the value of thehealth
record component.- Returns:
- the value of the
health
record component
-
eyeHeight
public float eyeHeight()Returns the value of theeyeHeight
record component.- Returns:
- the value of the
eyeHeight
record component
-
dimensions
public net.minecraft.world.entity.EntityDimensions dimensions()Returns the value of thedimensions
record component.- Returns:
- the value of the
dimensions
record component
-
icon
Returns the value of theicon
record component.- Returns:
- the value of the
icon
record component
-