juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
296 stars 50 forks source link

1.20 support? #118

Closed MeexReay closed 3 days ago

MeexReay commented 9 months ago

love this library, pls 1.20 support

derklaro commented 9 months ago

There is already full 1.20 support in v3 🙂

Panda260 commented 5 months ago

also 1.20.4 Support?

derklaro commented 5 months ago

Should be, but there might be some new entity poses missing. Everything else should work fine.

Cryptite commented 5 months ago

Indeed i haven't had luck with poses in 1.20.4, unsure what's changed.

derklaro commented 5 months ago

I've just took a look and entity pose meta is still the same in 1.20.4, except some new poses are missing. Gonna add them later.

Cryptite commented 5 months ago

Can you provide a code example on how to use them? Even using old poses, I've tried a few ways to get them to send to players and none seem to work

derklaro commented 5 months ago

Well, if you're running 1.20.4, just set the sneak meta. This will indirectly cause a pose update to sneaking.

Cryptite commented 5 months ago

Yeah the sneakingMetaFactory() one works, but the previous way of providing a Collection<EntityStatus> to a entityStatusMetaFactory() is what doesn't work.

derklaro commented 5 months ago

Weird, a few days ago I've tried to set the elytra flying status without any issues... Can you pass the code snippet you're using to set the entity status?

Cryptite commented 5 months ago
Collection<EntityStatus> statuses = Set.of(EntityStatus.SWIMMING);
npc.changeMetadata(EntityMetadataFactory.entityStatusMetaFactory(), statuses).schedule(player);
derklaro commented 5 months ago

Can you try using FLYING_WITH_ELYTRA?

Cryptite commented 5 months ago

Yeah looks like that works but only when you approach npcs close enough that they turn towards you.