diff --git a/patches/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch b/patches/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch index 688628b355..aff8196155 100644 --- a/patches/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch +++ b/patches/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch @@ -24,3 +24,12 @@ double d0 = p_32141_.getX() - this.getX(); double d1 = p_32141_.getY(0.3333333333333333) - abstractarrow.getY(); double d2 = p_32141_.getZ() - this.getZ(); +@@ -200,7 +_,7 @@ + + @Override + public boolean canFireProjectileWeapon(ProjectileWeaponItem p_32144_) { +- return p_32144_ == Items.BOW; ++ return p_32144_.getDefaultInstance().is(net.neoforged.neoforge.common.Tags.Items.SKELETON_USABLE_BOWS); + } + + @Override diff --git a/src/generated/resources/assets/c/lang/en_us.json b/src/generated/resources/assets/c/lang/en_us.json index 626b385a89..a557be3965 100644 --- a/src/generated/resources/assets/c/lang/en_us.json +++ b/src/generated/resources/assets/c/lang/en_us.json @@ -362,6 +362,7 @@ "tag.item.c.tools.spear": "Spears", "tag.item.c.villager_job_sites": "Villager Job Sites", "tag.item.neoforge.enchanting_fuels": "Enchanting Fuels", + "tag.item.neoforge.skeleton_usable_bows": "Skeleton Usable Bows", "tag.worldgen.biome.c.hidden_from_locator_selection": "Hidden From Locator's Selection", "tag.worldgen.biome.c.is_aquatic": "Aquatic", "tag.worldgen.biome.c.is_aquatic_icy": "Aquatic Icy", diff --git a/src/generated/resources/data/neoforge/tags/item/skeleton_usable_bows.json b/src/generated/resources/data/neoforge/tags/item/skeleton_usable_bows.json new file mode 100644 index 0000000000..a1c8a443dc --- /dev/null +++ b/src/generated/resources/data/neoforge/tags/item/skeleton_usable_bows.json @@ -0,0 +1,5 @@ +{ + "values": [ + "minecraft:bow" + ] +} \ No newline at end of file diff --git a/src/main/java/net/neoforged/neoforge/common/Tags.java b/src/main/java/net/neoforged/neoforge/common/Tags.java index c4dfe263b7..c5d8b96a7a 100644 --- a/src/main/java/net/neoforged/neoforge/common/Tags.java +++ b/src/main/java/net/neoforged/neoforge/common/Tags.java @@ -271,6 +271,11 @@ public static class Items { * This tag defaults to {@link net.minecraft.world.item.Items#LAPIS_LAZULI} when not present in any datapacks, including forge client on vanilla server */ public static final TagKey ENCHANTING_FUELS = neoforgeTag("enchanting_fuels"); + /** + * Controls what bows can be used by {@link net.minecraft.world.entity.monster.AbstractSkeleton} + * This tag defaults to {@link net.minecraft.world.item.Items#BOW} when not present in any datapacks, including forge client on vanilla server + */ + public static final TagKey SKELETON_USABLE_BOWS = neoforgeTag("skeleton_usable_bows"); // `c` tags for common conventions public static final TagKey BARRELS = tag("barrels"); diff --git a/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeItemTagsProvider.java b/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeItemTagsProvider.java index f683fa8a72..27b7520554 100644 --- a/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeItemTagsProvider.java +++ b/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeItemTagsProvider.java @@ -222,6 +222,7 @@ public void addTags(HolderLookup.Provider lookupProvider) { tag(Tags.Items.SEEDS_MELON).add(Items.MELON_SEEDS); tag(Tags.Items.SEEDS_PUMPKIN).add(Items.PUMPKIN_SEEDS); tag(Tags.Items.SEEDS_WHEAT).add(Items.WHEAT_SEEDS); + tag(Tags.Items.SKELETON_USABLE_BOWS).add(Items.BOW); tag(Tags.Items.SLIMEBALLS).add(Items.SLIME_BALL); // Deprecated tag(Tags.Items.SLIME_BALLS).add(Items.SLIME_BALL).addOptionalTag(Tags.Items.SLIMEBALLS); tag(Tags.Items.SHULKER_BOXES) diff --git a/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeLanguageProvider.java b/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeLanguageProvider.java index f8cb9f9f26..7c8e0707d3 100644 --- a/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeLanguageProvider.java +++ b/src/main/java/net/neoforged/neoforge/common/data/internal/NeoForgeLanguageProvider.java @@ -300,6 +300,7 @@ protected void addTranslations() { add(Tags.Items.SEEDS_MELON, "Melon Seeds"); add(Tags.Items.SEEDS_PUMPKIN, "Pumpkin Seeds"); add(Tags.Items.SEEDS_WHEAT, "Wheat Seeds"); + add(Tags.Items.SKELETON_USABLE_BOWS, "Skeleton Usable Bows"); add(Tags.Items.SHULKER_BOXES, "Shulker Boxes"); add(Tags.Items.SLIME_BALLS, "Slimeballs"); add(Tags.Items.SLIMEBALLS, "Slimeballs");