Package journeymap.api.v2.client.entity
Interface WrappedEntity
public interface WrappedEntity
This interface is used for setting values of an entity, this controls how an entity is displayed.
Setting values on the entity itself will have no impact on how journeymap displays it.
Values are reset each time Journeymap refreshes the entity cache.
-
Method Summary
Modifier and TypeMethodDescriptiongetAggro()If the entity is aggro toward the playernet.minecraft.world.level.biome.BiomegetBiome()Gets the entity's biome.net.minecraft.core.BlockPosThe chunk position of the entity.intgetColor()Gets the color of the icon displayed on the map.net.minecraft.network.chat.ComponentThe entity's custom name.net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> The dimension where the entity is located.net.minecraft.resources.ResourceLocationThe icon resource location.The entity id, typically a UUID string.WeakReference<net.minecraft.world.entity.Entity> This is a weak reference to the Entity, setting any values on this entity will not change how journeymap displays or interacts with the entity.List<net.minecraft.network.chat.Component> Gets the current entity tooltipdoubleThe heading of the entity.If the entity is hostileintGets the label color of the icon displayed on the map.net.minecraft.world.entity.EntitygetOwner()The owner Entity if the Entity is tamed.The player's name if the entity is a player.net.minecraft.world.phys.Vec3The position of the entity.The profession of the npc.Is the entity is a player and undergroundbooleanIs entity an ambient creature.booleanIs the entity disabled from being drawn on the map.booleanIs entity invisible to the current player.booleanisNpc()Is entity an npcbooleanIs entity a passive animalbooleanIs entity sneakingvoidsetColor(int color) Sets the icon color of the dot when the user has the display set to dots.voidsetCustomName(String customName) Sets the custom name of the entity.voidsetCustomName(net.minecraft.network.chat.Component customName) Sets the custom name of the entity.voidsetDisable(boolean disable) Disables the entity from being drawn on the map.voidsetDrawOutline(boolean drawOutline) When setting a custom image via `setEntityIconLocation` if you want to disable the outline when users have their entity icons drawing outlines.voidsetEntityIconLocation(net.minecraft.resources.ResourceLocation entityIconLocation) Set the icon location for the entity.voidsetEntityToolTips(List<net.minecraft.network.chat.Component> entityToolTips) Sets the entity tooltip.voidsetLabelColor(int color) Sets the label color for the entity.
-
Method Details
-
getEntityRef
WeakReference<net.minecraft.world.entity.Entity> getEntityRef()This is a weak reference to the Entity, setting any values on this entity will not change how journeymap displays or interacts with the entity.- Returns:
- The entity reference.
-
getEntityId
String getEntityId()The entity id, typically a UUID string.- Returns:
- the entity id.
-
getEntityIconLocation
@Nullable net.minecraft.resources.ResourceLocation getEntityIconLocation()The icon resource location.- Returns:
- - resource location.
-
getHostile
Boolean getHostile()If the entity is hostile- Returns:
- - the hostile boolean.
-
getAggro
Boolean getAggro()If the entity is aggro toward the player- Returns:
- - the aggro boolean.
-
getPosition
net.minecraft.world.phys.Vec3 getPosition()The position of the entity.- Returns:
- - the position vector.
-
getChunkPos
net.minecraft.core.BlockPos getChunkPos()The chunk position of the entity. They y position is not the entity block Y. It is the Y slice.- Returns:
- Block position of the entity's chunk.
-
getHeading
double getHeading()The heading of the entity.- Returns:
- - the heading.
-
getCustomName
@Nullable net.minecraft.network.chat.Component getCustomName()The entity's custom name. This is a custom name that is set on an entity. It is not a the name of the pet.- Returns:
- - the custom name.
-
getOwner
@Nullable net.minecraft.world.entity.Entity getOwner()The owner Entity if the Entity is tamed.- Returns:
- - the owner.
-
getProfession
The profession of the npc.- Returns:
- - the profession.
-
getPlayerName
The player's name if the entity is a player.- Returns:
- - the playername.
-
getBiome
@Nullable net.minecraft.world.level.biome.Biome getBiome()Gets the entity's biome.- Returns:
- - the Biome.
-
getDimension
net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimension()The dimension where the entity is located.- Returns:
- - the dimension.
-
getUnderground
Is the entity is a player and underground- Returns:
- - is underground.
-
isInvisible
boolean isInvisible()Is entity invisible to the current player.- Returns:
- - is invisible.
-
isSneaking
boolean isSneaking()Is entity sneaking- Returns:
- - is sneaking.
-
isPassiveAnimal
boolean isPassiveAnimal()Is entity a passive animal- Returns:
- - is a passive animal.
-
isAmbientCreature
boolean isAmbientCreature()Is entity an ambient creature.- Returns:
- is an ambient creature
-
isNpc
boolean isNpc()Is entity an npc- Returns:
- - is npc.
-
getColor
int getColor()Gets the color of the icon displayed on the map.- Returns:
- - the color
-
getLabelColor
int getLabelColor()Gets the label color of the icon displayed on the map.- Returns:
- - the color
-
isDisabled
boolean isDisabled()Is the entity disabled from being drawn on the map.- Returns:
- - is disabled.
-
getEntityToolTips
Gets the current entity tooltip- Returns:
- - The tooltip list
-
setEntityToolTips
Sets the entity tooltip.- Parameters:
entityToolTips- - The tooltip list
-
setEntityIconLocation
void setEntityIconLocation(net.minecraft.resources.ResourceLocation entityIconLocation) Set the icon location for the entity. The icon is the image shown on the map if the player has display type set to icon.- Parameters:
entityIconLocation- - the resource location of the icon.
-
setCustomName
void setCustomName(net.minecraft.network.chat.Component customName) Sets the custom name of the entity.- Parameters:
customName- - the custom name Component.
-
setCustomName
Sets the custom name of the entity.- Parameters:
customName- - the custom name value.
-
setLabelColor
void setLabelColor(int color) Sets the label color for the entity. Avoid if setting the color in the component.- Parameters:
color- - the color.
-
setColor
void setColor(int color) Sets the icon color of the dot when the user has the display set to dots.- Parameters:
color- - the color.
-
setDisable
void setDisable(boolean disable) Disables the entity from being drawn on the map.- Parameters:
disable- - the disable.
-
setDrawOutline
void setDrawOutline(boolean drawOutline) When setting a custom image via `setEntityIconLocation` if you want to disable the outline when users have their entity icons drawing outlines. Set to false, this is Default: true.- Parameters:
drawOutline- - to draw the icons outlines.
-