#Event.Player.Attributes how do you get and set Attributes

13 messages · Page 1 of 1 (latest)

neon ether
#

I'm trying to set 'forge:swin_speed'
but I want to read from it and add a percentage to it
I know that /Attributes command can be used to set it.

let player = e.entity;
    console.log(player)
    console.log(player.getAttributes("forge:swim_speed"))
        console.log(player.attributes("forge:swim_speed"))
    let oldSwimLevel = player.getAttributes("forge:swim_speed") || 1

im kind of lost how to access this
everythign points to net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation

frank glacierBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

echo terrace
#

maybe try player.getAttributeValue("forge:swim_speed")?

coarse sun
#

Idk If this is related but: #off-topic message

tropic yarrowBOT
#
lat

[Quote ➤](#off-topic message) ```java
double dist = player.getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue();
Vec3d start = player.getPositionEyes(1F);
Vec3d look = player.getLookVec();
Vec3d end = start.add(look.x * dist, look.y * dist, look.z * dist);
RayTraceResult ray = collisionRayTrace(state, world, pos, start, end);

neon ether
echo terrace
#

you're not going to believe this

#

it's setAttributeBaseValue for some reason though

neon ether
#

-_-

echo terrace
#

👍

neon ether
#

i hate my life where did you find that?

echo terrace
#

probejs

neon ether
#

👍