Fabric API

Fabric API

106M Downloads

EntitySelectorOptionRegistry usage documentation is outdated

haykam821 opened this issue ยท 0 comments

commented

In Minecraft 1.21, entity selector options were refactored. The existing documentation is no longer valid, particularly with the now-missing EntitySelectorReader#setPredicate method:

* <pre>{@code
* EntitySelectorOptionRegistry.register(
* Identifier.of("example", "min_health"),
* Text.literal("Minimum entity health"),
* (reader) -> {
* final float minHealth = reader.getReader().readFloat();
*
* if (minHealth > 0) {
* reader.setPredicate((entity) -> entity instanceof LivingEntity livingEntity && livingEntity.getHealth() >= minHealth);
* }
* },
* (reader) -> true
* );
* }</pre>