Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
hjake123 committed Oct 1, 2024
1 parent fa4043e commit cc63d51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/resources/server/enchantments/builtin.md
Original file line number Diff line number Diff line change
@@ -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`.
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/server/enchantments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConditionalEffect<T>>` evaluates the conditions, and runs a `Consumer<T>` on each `T` contained by a `ConditionalEffect` whose condition was met. Since many of Vanilla Enchantment Effect Components are defined as `List<ConditionalEffect<?>>`, 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<ConditionalEffect<T>>`, evaluates the conditions, and runs a `Consumer<T>` on each `T` contained by a `ConditionalEffect` whose condition was met. Since many of Vanilla Enchantment Effect Components are defined as `List<ConditionalEffect<?>>`, these can be directly plugged into the helper method like so:
```java
// `enchant` is an Enchantment instance.
// `lootContext` is a LootContext instance.
Expand Down Expand Up @@ -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<?>, DataComponentType<ConditionalEffect<Increment>>> INCREMENT =
ENCHANTMENT_COMPONENT_TYPES.register("increment",
Expand Down Expand Up @@ -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 `<project root>/src/generated/data/<modid>/enchantment/<path>.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].
<Tabs>
<TabItem value="datagen" label="Datagen">
Expand Down

1 comment on commit cc63d51

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: cc63d518c0cb0039b9178bf340ea57c70153da7a
Status: ✅ Deploy successful!
Preview URL: https://13423e7d.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-165.neoforged-docs-previews.pages.dev

Please sign in to comment.