From cc63d518c0cb0039b9178bf340ea57c70153da7a Mon Sep 17 00:00:00 2001 From: hjake123 Date: Tue, 1 Oct 2024 14:58:27 -0500 Subject: [PATCH] Typo --- docs/resources/server/enchantments/builtin.md | 2 +- docs/resources/server/enchantments/index.md | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/resources/server/enchantments/builtin.md b/docs/resources/server/enchantments/builtin.md index 1f36c02e..75c51a06 100644 --- a/docs/resources/server/enchantments/builtin.md +++ b/docs/resources/server/enchantments/builtin.md @@ -1,6 +1,6 @@ # Built-In Enchantment Effect Components -Vanilla Minecraft provides mumerous different types of Enchantment Effect Components for use in [enchantment] definitions. This article will explain each, including their usage and in-code definition. +Vanilla Minecraft provides numerous different types of Enchantment Effect Components for use in [enchantment] definitions. This article will explain each, including their usage and in-code definition. ## Value Effect Components [Value Effect Components] are used for enchantments that alter a numerical value somewhere in the game, and are implemented by the class `EnchantmentValueEffect`. diff --git a/docs/resources/server/enchantments/index.md b/docs/resources/server/enchantments/index.md index 1f6bfea3..6c33d5e6 100644 --- a/docs/resources/server/enchantments/index.md +++ b/docs/resources/server/enchantments/index.md @@ -111,7 +111,7 @@ Specifically, each `ConditionalEffect` contains another effect component, along `ConditionalEffect` wraps this behavior, allowing one to simply call `ConditionalEffect#matches(LootContext context)` to determine if the effect should be allowed to run. -Vanilla adds an additional helper method to further streamline the process of checking these conditions: `Enchantment#applyEffects()`. This method takes a `List>` evaluates the conditions, and runs a `Consumer` on each `T` contained by a `ConditionalEffect` whose condition was met. Since many of Vanilla Enchantment Effect Components are defined as `List>`, these can be directly plugged into the helper method like so: +Vanilla adds an additional helper method to further streamline the process of checking these conditions: `Enchantment#applyEffects()`. This method takes a `List>`, evaluates the conditions, and runs a `Consumer` on each `T` contained by a `ConditionalEffect` whose condition was met. Since many of Vanilla Enchantment Effect Components are defined as `List>`, these can be directly plugged into the helper method like so: ```java // `enchant` is an Enchantment instance. // `lootContext` is a LootContext instance. @@ -151,7 +151,9 @@ public record Increment(int value){ return value() + x; } } +``` +```java // Register an Enchantment Effect Component to carry this record. public static final DeferredHolder, DataComponentType>> INCREMENT = ENCHANTMENT_COMPONENT_TYPES.register("increment", @@ -197,7 +199,7 @@ Note that in this example, the level of the enchantment does not affect the outc ## Enchantment Data Generation Enchantment JSON files can be created automatically using the [data generation] system by passing a `RegistrySetBuilder` into `DatapackBuiltInEntriesProvider`. The JSON will be placed in `/src/generated/data//enchantment/.json`. -For more information on how RegistrySetBuilder and DatapackBuiltinEntriesProvider work, please see the article on [Data Generation for Datapack Registries]. +For more information on how `RegistrySetBuilder` and `DatapackBuiltinEntriesProvider` work, please see the article on [Data Generation for Datapack Registries].