#/enchant command

1 messages ยท Page 1 of 1 (latest)

peak cedar
#

works, kinda...

#
    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?

ancient flame
#

You want the command to be capitalized?

peak cedar
#

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

ancient flame
#

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

peak cedar
#

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>

ancient flame
#

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

peak cedar
#

huh?

(im a bit special)

ancient flame
#

the syntax is %strings% in proper case
It has to be a string, your {_enchant} is not a string

peak cedar
#

alr so turns out im really special, and all i had to do was use my eyes

peak cedar
#

lines for comparison

ancient flame
#

btw you overwrote your {_enchant} so the tool is not being enchanted anymore

ancient flame
#

Well, I can only assume the space is because of the colored arg-3 but Im not sure

peak cedar
#

so what would i do

ancient flame
#

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
peak cedar
ancient flame
#

hmmmm

#

add (formatted "%arg-3%%"%{_enchant}%" in proper case%%arg-2%") to lore of player's tool ?

peak cedar
ancient flame
#

oops

#

add back your arg3 for the color code

peak cedar
#

what

#

?

ancient flame
#

what did you have your arg3 as?

#

like what was it used for?

peak cedar
#

color

ancient flame
#
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
peak cedar
peak cedar
#

anyway i gottta get off for the weeked, ty for helping me maybe we can resume when i get back

split socket
split socket
split socket
hoary haven
split socket
#

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:...

peak cedar
peak cedar
#

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.

split socket
peak cedar
hoary haven
#

did you add an argument?

peak cedar
hoary haven
#

the command above only has 2

#

you are trying to input 3

peak cedar
#

the first line is supposed to look like this:
command /enchant <enchantment> <int> <text>:

split socket
#

i dont know why the smurfyguy sent the other thing then

peak cedar
#

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 ๐Ÿ˜ญ
peak cedar
#

thats all i wanted ๐Ÿ™

split socket
#
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

peak cedar
#

it also does this

split socket
#

you should just be able to add set enchantment level of arg-1 of player's tool to arg-2

peak cedar
split socket
#

whats wrong with that

#

do you want Efficiency 20?

peak cedar
#

Efficiency 20

split socket
#

ah ok

peak cedar
#

yea

split socket
#

just reverse arg-2 and arg-1 in the string

peak cedar
# split socket 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

split socket
#

reverse arg-2 and arg-1 when you're making them proper case

peak cedar
#

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
split socket
#

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
peak cedar
#

omg tysm, just one more question, can you do it with hex codes?

split socket
#

idk try it

#

format is <#RRGGBB>

peak cedar
#

bro tysm