From f698c5d700a42662d5a1e69800a369ef96cf0aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ossi=20Erkkil=C3=A4?= Date: Mon, 27 Jul 2026 20:48:49 +0300 Subject: [PATCH] Add keys related to minecraft:equippable data component --- .../java/org/spongepowered/api/data/Keys.java | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spongepowered/api/data/Keys.java b/src/main/java/org/spongepowered/api/data/Keys.java index 933e0aa312..f67f4e5334 100644 --- a/src/main/java/org/spongepowered/api/data/Keys.java +++ b/src/main/java/org/spongepowered/api/data/Keys.java @@ -397,6 +397,11 @@ public final class Keys { */ public static final Key> AMBIENT_PARTICLE = Keys.key(ResourceKey.sponge("ambient_particle"), ParticleConfig.class); + /** + * The set of {@link EntityType} allowed to equip an {@link ItemStack}. + */ + public static final Key>> ALLOWED_ENTITIES = Keys.setKey(ResourceKey.sponge("allowed_entities"), new TypeToken<>() {}); + /** * The ambient sound in a {@link Biome} * Readonly @@ -648,6 +653,16 @@ public final class Keys { */ public static final Key>> BYPASS_DAMAGE_TAG = Keys.key(ResourceKey.sponge("bypass_damage_tag"), new TypeToken<>() {}); + /** + * The {@link ResourceKey} overlay rendered when {@link ItemStack} equipped on head. + */ + public static final Key> CAMERA_OVERLAY = Keys.key(ResourceKey.sponge("camera_overlay"), ResourceKey.class); + + /** + * Whether an equipped {@link ItemStack} can be removed using shears. + */ + public static final Key> CAN_BE_SHEARED = Keys.key(ResourceKey.sponge("can_be_sheared"), Boolean.class); + /** * Whether an {@link ItemStack} can always be eaten. */ @@ -960,6 +975,11 @@ public final class Keys { */ public static final Key> DAMAGE_ABSORPTION = Keys.key(ResourceKey.sponge("damage_absorption"), Double.class); + /** + * Whether an equipped {@link ItemStack} is damaged when the wearer is hurt. + */ + public static final Key> DAMAGE_ON_HURT = Keys.key(ResourceKey.sponge("damage_on_hurt"), Boolean.class); + /** * How much damage a {@link FallingBlock} deals to {@link Living} entities * it hits per block fallen. @@ -1128,11 +1148,20 @@ public final class Keys { */ public static final Key> ENTITY_TO_SPAWN = Keys.key(ResourceKey.sponge("entity_to_spawn"), EntityArchetype.class); + /** + * Whether an item is equipped when interacting with it. + */ + public static final Key> EQUIP_ON_INTERACT = Keys.key(ResourceKey.sponge("equip_on_interact"), Boolean.class); + + /** + * The {@link SoundType} played when equipping an item. + */ + public static final Key> EQUIP_SOUND = Keys.key(ResourceKey.sponge("equip_sound"), SoundType.class); + /** * The {@link EquipmentType} that the target inventory supports. This usually applies to {@link EquipmentSlot}s. * or * The {@link EquipmentType} of an {@link ItemStack} - * Readonly */ public static final Key> EQUIPMENT_TYPE = Keys.key(ResourceKey.sponge("equipment_type"), EquipmentType.class); @@ -1814,6 +1843,11 @@ public final class Keys { */ public static final Key> IS_DISARMED = Keys.key(ResourceKey.sponge("is_disarmed"), Boolean.class); + /** + * Whether an item can be equipped using a dispenser. + */ + public static final Key> IS_DISPENSABLE = Keys.key(ResourceKey.sponge("is_dispensable"), Boolean.class); + /** * Whether an entity is eating. * e.g. {@link Panda} @@ -2179,6 +2213,11 @@ public final class Keys { */ public static final Key> IS_SURROGATE_BLOCK = Keys.key(ResourceKey.sponge("is_surrogate_block"), Boolean.class); + /** + * Whether an equipped item can be swapped by interacting with it. + */ + public static final Key> IS_SWAPPABLE = Keys.key(ResourceKey.sponge("is_swappable"), Boolean.class); + /** * Whether players are prevented from taking * items from an equipment slot on an {@link ArmorStand} @@ -3093,6 +3132,11 @@ public final class Keys { */ public static final Key> SHADOW_STRENGTH = Keys.key(ResourceKey.sponge("shadow_strength"), Double.class); + /** + * The {@link SoundType} played when removing an equipped {@link ItemStack} using shears. + */ + public static final Key> SHEARING_SOUND = Keys.key(ResourceKey.sponge("shearing_sound"), SoundType.class); + /** * The sound played when blocking an attack with a shield-like {@link ItemStack}. */