CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
570 stars 299 forks source link

Player NPCs crawling #2737

Open VladMoore opened 2 years ago

VladMoore commented 2 years ago

I confirm that I have ...

Description

1.As of 1.14 (I believe) players have been able to get into a crawling position in 1 block vertical gap. It just seems like something an NPC should be able to do.

  1. A lot of cool builds could be achieved by having NPCs crawl or lay; like crime scenes, etc.
  2. I have not found an alternative, unfortunately.

Code Example

No response

fullwall commented 2 years ago

Is this for pathfinding? I thought this was a visual thing when in small gaps

mcmonkey4eva commented 2 years ago

Theoretically you can just call LivingEntity#setSwimming(true) and it should apply the visual effect (crawling and swimming are the same stance internally). In practice, this doesn't currently work on NPCs, so there's likely something in the NMS that would need to be changed for it to be possible to apply.

For real players, it works (excluding self-view) with a combination of setSwimming(true) and cancelling EntityToggleSwimEvent when event.isSwimming() is false. (For a player to see it on their own client, there's a much more complicated solution, but that can be ignored for NPC usage)

HowardZHY commented 2 years ago

is there a way to let player type NPCs sitting(riding on a arrow) ?

mcmonkey4eva commented 2 years ago

@HowardZHY ask on Discord @ https://discord.gg/Q6pZGSR , don't hijack unrelated github issues please

HowardZHY commented 2 years ago

my discord is unavailable now. sorry about that.

At 2022-05-02 06:47:32, "mcmonkey4eva" @.***> wrote:

@HowardZHY ask on Discord @ https://discord.gg/Q6pZGSR , don't hijack unrelated github issues please

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>