You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/paper/dev/api/data-component-api.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
2
slug: /dev/data-component-api
3
-
description: A guide to the ItemStack DataComponent API.
3
+
description: A guide to the ItemStack data component API.
4
4
---
5
5
6
6
# Data Component API
7
7
8
8
:::danger[Experimental]
9
9
10
-
The DataComponent API is currently experimental, and is additionally subject to change across versions.
10
+
The data component API is currently experimental, and is additionally subject to change across versions.
11
11
12
12
:::
13
13
14
-
The DataComponent API provides a version-specific interface for accessing and manipulating item data that is otherwise not representable by the `ItemMeta` API.
14
+
The data component API provides a version-specific interface for accessing and manipulating item data that is otherwise not representable by the `ItemMeta` API.
15
15
Through this API, you can read and modify properties of an item, so called data components, in a stable and object-oriented manner.
16
16
17
17
@@ -52,11 +52,11 @@ While `ItemMeta` is still very useful, it does not properly represent the protot
52
52
### Key differences
53
53
54
54
#### Expanded data model
55
-
The DataComponent API exposes a much broader and more detailed set of item properties than `ItemMeta`.
55
+
The data component API exposes a much broader and more detailed set of item properties than `ItemMeta`.
56
56
Data components allow the entire item to be modified in a fashion that better represents how Minecraft does item modifications.
57
57
58
58
#### Version-specific
59
-
The DataComponent API is designed to adapt to version changes. The DataComponent API may experience breaking changes on version updates as Minecraft makes changes to components.
59
+
The data component API is designed to adapt to version changes. The data component API may experience breaking changes on version updates as Minecraft makes changes to components.
60
60
Backwards compatibility is not promised.
61
61
62
62
Because `ItemMeta` is represented in a different format, breaking changes made to components by Mojang may not result in breaking changes to `ItemMeta`.
@@ -72,7 +72,7 @@ durability or default attributes.
72
72
Currently, `ItemMeta` represents a **snapshot** of an `ItemStack`'s patched map.
73
73
This is expensive as it requires the entire patch to be read, even values that you may not be using.
74
74
75
-
The DataComponent API integrates directly with `ItemStack`. Although conceptually similar, the DataComponent API focuses on explicit, strongly typed data retrieval and updates without this additional overhead.
75
+
The data component API integrates directly with `ItemStack`. Although conceptually similar, the data component API focuses on explicit, strongly typed data retrieval and updates without this additional overhead.
76
76
77
77
### When should I use `DataComponents` or `ItemMeta`?
78
78
@@ -88,7 +88,7 @@ You would want to use data components if you:
88
88
89
89
90
90
## Basic usage
91
-
The DataComponent API will fetch values according to the behavior seen in game. So, if the patch removes the `minecraft:tool` component,
91
+
The data component API will fetch values according to the behavior seen in game. So, if the patch removes the `minecraft:tool` component,
0 commit comments