#(itzmxritz) NPC is sneaking when SneakTrait gets added

11 messages · Page 1 of 1 (latest)

calm needle
#

I want to check if an npc is sneaking or not.

public boolean isSneaking() {
  return citizen.getOrAddTrait(SneakTrait.class).isSneaking();
}```

when i call this method when the SneakTrait isnt applied to the npc, it will sneak and the boolean is true, without setting it to true.
Is there a way i can fix, that the sneaking is false when the trait gets applied?
pale waspBOT
#

(itzmxritz) NPC is sneaking when SneakTrait gets added

pale waspBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

raven kindle
#

@calm needle you can check with hasTrait

obsidian vortexBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@calm needle

raven kindle
#

checking if an entity is sneaking is different to checking if an NPC has the sneaking trait

#

btw

obsidian vortexBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@calm needle