#/enchant command
1 messages ยท Page 1 of 1 (latest)
permission: op
trigger:
set {_enchant} to "%arg-1% %arg-2%" parsed as enchantment type
enchant player's held item with {_enchant}
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to arg-1
add "%colored arg-3%%{_enchant} in proper case% %arg-2%" to player's tool's lore```
so it adds the command and works fine, but i want it to capitalized and it just dosent no matter how i put the command
@ancient flame could you help me?
You want the command to be capitalized?
so basically i want so when it puts the lore on the item, i want it to be capitalized but it wont even if i make it capitalized in the command
thats because color codes mess up the captilzation of strings
example
"efficiency" in proper case -> "Efficiency"
"&befficiency" in proper case -> "&Befficiency"
there's currently no fix for it afaik
well
the only fix you can do is separating the color code from the first word
"&b efficiency"
or use hex colors
thought im not sure if that works or not
when i spaced it like this
permission: op
trigger:
set {_enchant} to "%arg-1% %arg-2%" parsed as enchantment type
enchant player's held item with {_enchant}
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to arg-1
add "%colored arg-3% %{_enchant} in proper case% %arg-2%" to player's tool's lore```
it just says <none>
thats because {_enchant} is not a string, you parsed it as an enchantment type
well
you did that but then you set it to arg-1 which is an enchantment, which is still not a string
huh?
(im a bit special)
the syntax is %strings% in proper case
It has to be a string, your {_enchant} is not a string
alr so turns out im really special, and all i had to do was use my eyes
permission: op
trigger:
set {_enchant} to "%arg-1%"
enchant player's held item with {_enchant}
set player's tool to player's tool with hidden enchants item flag
add "%colored arg-3%%{_enchant} in proper case% %arg-2%" to player's tool's lore```
sorry for being so picky but now there is a space and i dont know how to remove it
lines for comparison
btw you overwrote your {_enchant} so the tool is not being enchanted anymore
how do i fix that :/
Well, I can only assume the space is because of the colored arg-3 but Im not sure
so what would i do
try this, I cant guarantee it will work
# Generated by FuseAI
command /enchant <enchantment type> <text>:
trigger:
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to enchantment of arg-1
add colored "%arg-3%%"%{_enchant}%" in proper case %arg-2%" to lore of player's tool
hmmmm
add (formatted "%arg-3%%"%{_enchant}%" in proper case%%arg-2%") to lore of player's tool ?
color
command /enchant <enchantment type> <text>:
trigger:
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to enchantment of arg-1
add (formatted "%arg-2%%"%{_enchant}%" in proper case%") to lore of player's tool
thats what i got when i ran that
anyway i gottta get off for the weeked, ty for helping me maybe we can resume when i get back
wtf is fuseai and stop using it ๐
command /enchant <enchantment type> <text>:
trigger:
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to enchantment of arg-1
set {_enchant} to formatted "%arg-2%" + ("%{_enchantment}%" in strict proper case)
add {_enchant} to lore of player's tool```
@tulip smelt no
Use ^(\&[\da-fmnlo])* and you can separate the colour prefixes from the string
doesnt work with hex codes though. not sure if it still converts them automatically to &x format though so many
.replaceAll("[&ยง][0-9a-fk-orx]", "").replaceAll("(<?<=<)(.*?)(?=>)", "");
thats the method i used to replace them in my old PR to fix the issue
should replace all of them including ones like hover:...
so how would i use hex codes with it?
i brought my laptop
this does not work, it does this
neither does it enchant the level i want, it only goes to level 1.
it does the right enchant, but it only puts level on the item.
is arg-2 supposed to be the enchantment level
Arg-1 = Enchant, Arg-2 = Level, Arg-3 = Color
did you add an argument?
what?
the first line is supposed to look like this:
command /enchant <enchantment> <int> <text>:
i dont know why the smurfyguy sent the other thing then
but however he did it does not work and if i mess around with it ima break it
permission: op
trigger:
set {_enchant} to "%arg-1% %arg-2%" parsed as enchantment type
enchant player's held item with {_enchant}
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to arg-1
add "%colored arg-3%%{_enchant} in proper case% %arg-2%" to player's tool's lore``` this is the original, and all i wanted it to do was capitalize the first letter bro ๐ญ
command /enchant <enchantment> <int> <text>:
trigger:
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to formatted arg-3 + ("%arg-2% %arg-1%" in strict proper case)
add {_enchant} to lore of player's tool```
there @peak cedar
nvm that doesnt set the level mb
it also does this
you should just be able to add set enchantment level of arg-1 of player's tool to arg-2
Efficiency 20
ah ok
yea
just reverse arg-2 and arg-1 in the string
trigger:
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to formatted arg-3 + ("%arg-2% %arg-1%" in strict proper case)
set enchantment level of arg-1 of player's tool to arg-2
add {_enchant} to lore of player's tool```like this?
still dosent enchant with level, and is still backwards
idfk whats happening
reverse arg-2 and arg-1 when you're making them proper case
okay fixed that but it dosent enchant
trigger:
set enchantment level of arg-1 of player's tool to arg-2
enchant player's tool with arg-1
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to formatted arg-3 + ("%arg-1% %arg-2%" in strict proper case)
add {_enchant} to lore of player's tool``` this is what i have and it dosent enchant
well you're setting it before
command /enchant <enchantment> <int> <text>:
trigger:
set enchantment level of arg-1 of player's tool to arg-2
set player's tool to player's tool with hidden enchants item flag
set {_enchant} to formatted arg-3 + ("%arg-1% %arg-2%" in strict proper case)
add {_enchant} to lore of player's tool
``` just do that
omg tysm, just one more question, can you do it with hex codes?
bro tysm