Skip to content

Conversation

xiaoliziawa
Copy link

@xiaoliziawa xiaoliziawa commented May 21, 2025

Description

Used to choose between double quotes or single quotes when copying item ID or Tag.

Because I have found that many players find it tedious to format between double and single quotes when copying things similar to ItemId while writing KubeJS code

Example Script

/kubejs quote_style double
/kubejs quote_style single

Use double style to display after pressing ctr+v in the editor

Item.of("minecraft:diamond")

Use single style to display after pressing Ctrl+V in the editor

Item.of('minecraft:dimaond')

Other details

Used to choose between double quotes or single quotes when copying Items Id or Tag
@xiaoliziawa xiaoliziawa changed the title Add a command kubejs /kjs quote_style double/single Add a command for kubejs /kjs quote_style double/single May 21, 2025
@xiaoliziawa
Copy link
Author

xiaoliziawa commented May 21, 2025

Due to the ClickEvent limitation of Minecraft itself, it has to be reused

/kubejs hand

Command to retrieve new item ID and Tag

@EvanHsieh0415
Copy link
Contributor

How about template string style?

Item.of(`xxx`)

@xiaoliziawa
Copy link
Author

xiaoliziawa commented May 22, 2025

How about template string style?

Item.of(`xxx`)

ok

@xiaoliziawa
Copy link
Author

xiaoliziawa commented May 22, 2025

Now using mixin to modify the original ClickEvent, no need to input again

/kubejs hand

Get a new item ID or Tag

@ChiefArug
Copy link
Contributor

ChiefArug commented May 30, 2025

IMO this should use an enum rather than a boolean to support template literal style strings as well.
I also think a mixin to modify ALL click events is the wrong way to go about this as that will affect other mods as well.

@xiaoliziawa
Copy link
Author

IMO this should use an enum rather than a boolean to support template literal style strings as well. I also think a mixin to modify ALL click events is the wrong way to go about this as that will affect other mods as well.

I think your idea is correct, and I have also considered this issue, but it seems that there are no mods that use ClickEvent to obtain the ID of an item, right?

@xiaoliziawa
Copy link
Author

xiaoliziawa commented May 30, 2025

IMO this should use an enum rather than a boolean to support template literal style strings as well. I also think a mixin to modify ALL click events is the wrong way to go about this as that will affect other mods as well.

If possible, perhaps we could revert back to my previous idea of having the user re-enter the /kubejs hand command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants