[GUIDE] @rename to help rename items

ezezeez

Member
Joined
May 19, 2023
Messages
80
there are many games i see where items are renamed by anvil and when I ask people why they do so they say because we don't have mod
well I don't have mod too but I have coding so here is a working code for it
for this you have to take the item u want to rename in your hand and then type @rename (name)
first you need to do
Player action(send message)-> set variable ( %player%msg(var) - Message sent(apple var) )
STEP 2 (getting the name and command from the msg)
Split text into characters - ( First slot ( %player%msg(array) second slot (%player%msg(var) third slot(empty) )
Array action (Get element First slot (%player%command(var) Second slot (%player%msg(array) Third slot(1(numerical value))
Array action (Get element First slot (%player%Amount(var) Second slot (%player%msg(array) Third slot(2(numerical value))
is variable equals (first slot%player%command(var) botton slot (@rename(book)) set item in hand to variable (%player%item1)(var) then set item name first slot ((%player%item1)(var) second slot(%player%item2)(var)third slot(%player%Amount(var))
player action give variable items((%player%item2)(var))
hope it helps
 

veddnt

Active member
Joined
Jun 2, 2023
Messages
201
Code:
# Player sends a message
Player action(send message) -> Set variable(%player%msg(var) - Message sent(apple var))

# STEP 2: Parsing the message to get the name and command
# Split the text into characters
Split text into characters - (
    First slot(%player%command(var))
    Second slot(%player%msg(array))
    Third slot(empty)
)

# Get the command from the message
Array action (Get element) - (
    First slot(%player%command(var))
    Second slot(%player%msg(array))
    Third slot(1)  # Numerical value
)

# Get the amount from the message
Array action (Get element) - (
    First slot(%player%Amount(var))
    Second slot(%player%msg(array))
    Third slot(2)  # Numerical value
)

# Check if the command is equal to "@rename(book)"
Is variable equals (
    First slot(%player%command(var))
    Botton slot(@rename(book))
) -> Set item in hand to variable(%player%item1(var))

# Set the item name
Then set item name - (
    First slot((%player%item1)(var))
    Second slot(%player%item2(var))
    Third slot(%player%Amount(var))
)

# Player action to give variable items
Player action give variable items((%player%item2)(var))

Made it easier to read for others
 

Ezolile

Member
Joined
May 19, 2023
Messages
42
what is among us if text contains?
Itchy is referring to option that you do not have to use Get Element code. Instead you can use variable with among us symbol ඞ.
It works like this: If you have an array named TEST and you want to get element at index number 6 for example instead of using get element code you could just use variable named TESTඞ5. This variable gets value from index 6 in your TEST array. So you can completely avoid to use Get Element code and save some time and space. Variable will be named with number 1 less then wanted index number because variables in an array start counting from 0.
But there is a thing that I haven't figured out yet. This works for unsaved arrays but what if array is saved? If it is saved it adds additional symbol besides among us and I can't find that symbol anywhere. I haven't been able to make it work with saved arrays. Maybe there is a simple thing that I am missing.
Here you can see symbol that i cant find next to among us symbol.
Saved array element.png
 
Last edited:

Ezolile

Member
Joined
May 19, 2023
Messages
42
Itchy is referring to option that you do not have to use Get Element code. Instead you can use variable with among us symbol ඞ.
It works like this: If you have an array named TEST and you want to get element at index number 6 for example instead of using get element code you could just use variable named TESTඞ6. This variable gets value from index 6 in your TEST array. So you can completely avoid to use Get Element code and save some time and space.
But there is a thing that I haven't figured out yet. This works for unsaved arrays but what if array is saved? If it is saved it adds additional symbol besides among us and I can't find that symbol anywhere. I haven't been able to make it work with saved arrays. Maybe there is a simple thing that I am missing.
Here you can see symbol that i cant find next to among us symbol.
View attachment 302
Never mind. I just found it lol. Like less then a minute after adding image to this post. ⎘ It is next page symbol. That is why I could not find it before. I am going to test it now.
 

ezezeez

Member
Joined
May 19, 2023
Messages
80
Itchy is referring to option that you do not have to use Get Element code. Instead you can use variable with among us symbol ඞ.
It works like this: If you have an array named TEST and you want to get element at index number 6 for example instead of using get element code you could just use variable named TESTඞ6. This variable gets value from index 6 in your TEST array. So you can completely avoid to use Get Element code and save some time and space.
But there is a thing that I haven't figured out yet. This works for unsaved arrays but what if array is saved? If it is saved it adds additional symbol besides among us and I can't find that symbol anywhere. I haven't been able to make it work with saved arrays. Maybe there is a simple thing that I am missing.
Here you can see symbol that i cant find next to among us symbol.
View attachment 302
thx for info I'll use this in future projects but what if i have multiple arrays?
 

Ezolile

Member
Joined
May 19, 2023
Messages
42
Itchy is referring to option that you do not have to use Get Element code. Instead you can use variable with among us symbol ඞ.
It works like this: If you have an array named TEST and you want to get element at index number 6 for example instead of using get element code you could just use variable named TESTඞ5. This variable gets value from index 6 in your TEST array. So you can completely avoid to use Get Element code and save some time and space. Variable will be named with number 1 less then wanted index number because variables in an array start counting from 0.
But there is a thing that I haven't figured out yet. This works for unsaved arrays but what if array is saved? If it is saved it adds additional symbol besides among us and I can't find that symbol anywhere. I haven't been able to make it work with saved arrays. Maybe there is a simple thing that I am missing.
Here you can see symbol that i cant find next to among us symbol.
View attachment 302
I edited post because i made one mistake. Keep in mind if you are using among us symbol to extract data from an array dynamic variable will be named with number 1 less then wanted index number in array. It is because array elements are dynamic variables that start their names count from 0, not from 1. Example: you have array named %player%_array and you want to get element from index 4 from that array. You can use dynamic variable named %player%_arrayඞ3. If you want element from index 1 from array you can use dynamic variable named %player%_arrayඞ0. Sorry if I confused you I haven't been using this much.
 

Ezolile

Member
Joined
May 19, 2023
Messages
42
thx for info I'll use this in future projects but what if i have multiple arrays?
Like veddnt said arrays will be named differently. 2 arrays named Test1 and Test2. You want to get value at index 1 from both of them you will use dynamic variables named Test1ඞ0 and Test2ඞ0.
 
Top