Custom advancement criterion registry
EliteMasterEric opened this issue ยท 5 comments
I am unable to determine how to add custom advancement criteria that I can trigger.
net.minecraft.advancement.criterion.CriterionCriterions
has a registration function but it is private. Unlike other registers, criterion do not have their own register yet.
this can in fact be easily done with a invoker mixin:
@SuppressWarnings("PublicStaticMixinMember")
@Mixin(Criterions.class)
public interface CriterionRegistryAccessor {
@Invoker("register")
static <T extends Criterion<?>> T registerCriterion(T criterion) {
return null;
}
}
the question remains whether that should be added to fabric API or whether mods should do that themselves, given how trivial the mixin is.
Advancement criteria are very repetitive - should Fabric API provide a general implementation plus the mixin hook