diff --git a/content/docs/en/guides/ecs/example-ecs-plugin.mdx b/content/docs/en/guides/ecs/example-ecs-plugin.mdx index 5f166f9b..183213d2 100644 --- a/content/docs/en/guides/ecs/example-ecs-plugin.mdx +++ b/content/docs/en/guides/ecs/example-ecs-plugin.mdx @@ -40,6 +40,7 @@ public class PoisonComponent implements Component { } // A builder codec is needed to allow components to be saved and loaded from disk + // NOTE: You must specify the codec when registering the component for it to save and load data. public static final BuilderCodec CODEC = BuilderCodec .builder(PoisonComponent.class, PoisonComponent::new) .append( @@ -230,7 +231,7 @@ public final class ExamplePlugin extends JavaPlugin { // Register the component & set the type in the component class so its easier to retrieve. ComponentType poisonComponentType = this.getEntityStoreRegistry() - .registerComponent(PoisonComponent.class, PoisonComponent::new); + .registerComponent(PoisonComponent.class, PoisonComponent::new, PoisonComponent.CODEC); PoisonComponent.setComponentType(poisonComponentType); this.getEntityStoreRegistry().registerSystem(new PoisonSystem(PoisonComponent.getComponentType()));