can i somehow change a command block command like lets say a sign that has a name like "wemmbu" now i need to make so if you change the name off the sign like to lets say "manepear" it will change the command from /player wemmbu spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld to /player manepear spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld maybe anothjer way dosent have to be a sign can be a book docked in a lectern or whatever just a wat to kinda input() something
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Yes! What you're trying to do can be accomplished in Minecraft Java Edition using command blocks and some creative redstone or function file tricks. Here's the idea:
You want a way to input a dynamic player name (like via a sign or book), and have a command block update based on that player name to run something like:
mcfunction
/player <dynamic_name> spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld
🎯 Your Goal:
Custom input (name) ➜ Dynamic command execution using that name.
✅ Best Method: ITEM NAME (Renamed Items + Lectern or Dropper)
Idea Summary:
Have a renameable item (like a Name Tag, Book, or Paper) placed in a special location (like a dropper or lectern), then use command blocks to read its name using /data get.
🧱 Solution Breakdown
🔧 STEP 1: Prepare a Container (like a Dropper)
Place a Dropper (or Chest) and feed it into a command block setup.
Players rename something (like Paper) in an Anvil, then drop it into the Dropper.
🔧 STEP 2: Use /data get to Read Item Name
For example, if a paper named manepear is in slot 0 of a Dropper at 0 64 0:
mcfunction
/data get block 0 64 0 Items[0].tag.display.Name
The result would be:
json
{"text":"manepear"}
In newer Minecraft versions (1.20+), you can use /execute store to store that and use it in tellraw, or in a scoreboard (storage or data).
But you can’t directly substitute strings into commands, so we need a workaround.
🌀 Workaround Options for Running Dynamic Commands
Because Minecraft doesn’t support dynamic command string substitution, the workaround is:
Option 1: Pre-define all valid player names (if the name list is small)
You create a set of command blocks (or a function file) mapping each possible input name.
Example:
mcfunction
execute if data block 0 64 0 Items[0].tag.display.Name = '{"text":"wemmbu"}' run <command block A>
execute if data block 0 64 0 Items[0].tag.display.Name = '{"text":"manepear"}' run <command block B>
Then command block A says:
mcfunction
/player wemmbu spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld
And command block B says:
mcfunction
/player manepear spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld
Not scalable for a lot of users though.
Option 2: Use a function file and execute as the player
If you're targeting actual online players, then:
mcfunction
execute as @a at @s run tp @s -35.53 286.00 54.09 facing 1 1
But that teleports everyone online. So instead, filter using a scoreboard:
When someone submits a name, use command blocks or data detection to assign them a tag (isTeleporting).
Then use:
mcfunction
execute as @a[tag=isTeleporting] at @s run tp @s -35.53 286.00 54.09 facing 1 1
🧪 Newer Method (Minecraft 1.20+ Only): Using Storage
Create a storage key:
mcfunction
/data modify storage my:spawn playerName set from block 0 64 0 Items[0].tag.display.Name
Then read the storage in custom logic.
Unfortunately, command blocks still don’t support injecting dynamic strings into a command like:
mcfunction
/player <value from storage> spawn ...
So, again, you'd still have to use tricks like a pre-defined set or /execute as <playername> or /teleport with selectors.
✅ Final Recommendation:
If you want a clean yet user-friendly system:
Have player rename a Paper in an Anvil to their Minecraft username (e.g., manepear).
Drop it into a Hopper or Dropper at a known location.
Use command blocks:
mcfunction
/data get block <x> <y> <z> Items[0].tag.display.Name
Compare using:
mcfunction
execute if data ...
Execute the relevant command:
mcfunction
/player manepear spawn at -35.53 286.00 54.09 facing 1 1 in minecraft:overworld
If your player base is small, you can pre-define everyone. If it's large, consider using tags, scoreboards, or selectors instead to generalize the command.
⚡Bonus Tech: Use Lecterns with Written Books?
If using a Lectern, players can write their name in a book and your system can read the book with:
mcfunction
/data get block <x> <y> <z> page
But reading book page content is a bit more annoying and slow than item names. I recommend paper or name tags.