Jump to content

[THEORY/BEST-USE] Trying to get a grip on EntityDataManager and Attributes


frakier

Recommended Posts


Trying to understand so consider all this one huge question.
Be sure and dumb it down, no or little code, just the why, the theory on use.

I can find code, I see what they do... but what is best practice?  Why use in attributes over datamanger or vice versa.
One of the reason I ask is I have seen in other mods where one coder will use the attributes for something and then another the datamanager for what seems to be the same thing.
 

The Entity Attribute System

    Seems that attributes have a range so if you are modifying them through magic or by the nature of a special variant you can have a min/max to check them against.

    You can share the attribute value and modifiers with the client, with setShouldWatch(true)

    Good article on attributes... the how but not which and why

 

EntityDataManager

==Data specific to the entity.
    -Manged with
     (writeAdditional readAdditional)

    -Has to be synched to the client with custom code [one way?].
    -Share the additional data, that you specify, between client and server
    (IPacket, writeSpawnData readSpawnData)
    -Has to be symetrical, whatever you share you have to read.
    writing two items and then reading one will cause problems?
        
Attributes (ranged min, max, default)

    ARMOR_TOUGHNESS
    ATTACK_DAMAGE
    ATTACK_KNOCKBACK
    ATTACK_SPEED
    ENTITY_GRAVITY
    FLYING_SPEED
    FOLLOW_RANGE
    KNOCKBACK_RESISTANCE
    LUCK
    MOVEMENT_SPEED
    NAMETAG_DISTANCE
    SPAWN_REINFORCEMENTS_CHANCE
    SWIM_SPEED
    MAX_HEALTH


    
AttributeModifier (spometing like if baby add BABY_SPEED_BOOST to MOVEMENT_SPEED?)

    BABY_SPEED_BOOST
    SLOW_FALLING
    SPRINTING_SPEED_BOOST

 

Data (any information specific to the enitity?)
(only some information will need to be syched to the client usually information of a viual nature or used in rendering)
 

    AI_FLAGS
    ARROW_COUNT_IN_ENTITY
    ATTACHED_BLOCK_POS
    ATTACHED_FACE
    ATTACKING
    BABY
    BED_POSITION
    BEGGING
    BOOST_TIME
    BOOST_TIME
    BREEDING_ITEMS
    BREEDING_TIME
    CAN_MIMIC
    CARRIED_BLOCK
    CAT_TYPE
    CLIMBING
    COLLAR_COLOR
    COLOR
    CONVERTING
    DATA_CHARGING_STATE
    DATA_HEALTH_ID
    DROWNING
    DYE_COLOR
    FOX_FLAGS
    FOX_TYPE
    FROM_BUCKET
    GOING_HOME
    GOT_FISH
    HANGING
    HAS_EGG
    HEALTH
    HIDDEN_GENE
    HIDE_PARTICLES
    HOME_POS
    IGNITED
    IS_CHILD
    IS_DIGGING
    IS_DRINKING
    IS_STANDING
    IS_TRUSTING
    ITEM_SELECTION
    LIVING_FLAGS
    MAIN_GENE
    MOISTNESS
    MOOSHROOM_TYPE
    MOVING
    ON_FIRE
    OWNER_UNIQUE_ID
    PANDA_FLAGS
    PEEK_TICK
    PHASE
    PLAYER_CREATED
    POTION_EFFECTS
    POWERD
    PUFF_STATE
    PUMPKIN_EQUIPPED
    RABBIT_TYPE
    SADDLED
    SCREAMING
    SIZE
    SLIME_SIZE
    SPELL
    STATE
    TAMED
    TARGET_ENTITY
    TEMPTATION_ITEMS
    TRAVEL_POS
    TRAVELLING
    TREASURE_POS
    TRUSTED_UUID_MAIN
    TRUSTED_UUID_SECONDARY
    VARIANT
    VARIANT
    VEX_FLAGS
    VILLAGER_DATA
    VILLAGER_TYPE
    SADDLED

 

Edited by frakier
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.