From 5d6993438c07d8be47084026d61a1070ea56e112 Mon Sep 17 00:00:00 2001 From: AnonymoDGH Date: Sat, 15 Aug 2026 19:07:29 -0500 Subject: [PATCH] fix(anvil): use the 50 character name limit on 1.17+ (#3945) --- lib/plugins/anvil.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/plugins/anvil.js b/lib/plugins/anvil.js index 9675a3a419..8a9fc3f644 100644 --- a/lib/plugins/anvil.js +++ b/lib/plugins/anvil.js @@ -6,6 +6,8 @@ module.exports = inject function inject (bot) { const Item = require('prismarine-item')(bot.registry) + // The anvil custom name limit was raised from 35 to 50 characters in 1.17 + const maxNameLength = bot.supportFeature('anvilNameLengthIsFifty') ? 50 : 35 const matchWindowType = window => /minecraft:(?:chipped_|damaged_)?anvil/.test(window.type) @@ -43,7 +45,7 @@ function inject (bot) { } async function combine (itemOne, itemTwo, name) { - if (name?.length > 35) err('Name is too long.') + if (name?.length > maxNameLength) err('Name is too long.') if (bot.supportFeature('useMCItemName')) { bot._client.registerChannel('MC|ItemName', 'string') } @@ -70,7 +72,7 @@ function inject (bot) { } async function rename (item, name) { - if (name?.length > 35) err('Name is too long.') + if (name?.length > maxNameLength) err('Name is too long.') if (bot.supportFeature('useMCItemName')) { bot._client.registerChannel('MC|ItemName', 'string') }