Zrips / CMI

116 stars 98 forks source link

newline not usable in custom alias #8334

Open DaniDipp opened 10 months ago

DaniDipp commented 10 months ago

Description of Issue

When setting up a custom alias command, newline characters are saved to the config correctly, but break the command when being executed.

I tried it with both \n and \u000a. Adding additional backslashes for more levels of escape characters does not help.

Reproduction steps:

  1. create new alias
  2. set command to
    tellraw @a {"text":"Hover me","hoverEvent":{"action":"show_text","value":[{"text":"Line1\nLine2"}]}}
  3. note the newline in the hover text
  4. try to run the alias. It will show the following error: 2023-12-16T14-18-59

Version Information

--------------------------------------------------
CMI: 9.6.9.3 Unknown  SqLite
CMILib: 1.4.4.2 
Server: Paper(318) 1.20.2-R0.1-SNAPSHOT-
CMI economy: Disabled CMI Chat: Enabled 
Modules -> 18 enabled 41 disabled: spawnerProximity, cuffed, versionCheck, armorEffects, moneyCheque, skin, elytraBoost, eventCommands, elytraLaunch, bossBarCompass, coloredArmor, playerCombat, votifier, shulkerBackpack, cooldown, headDrop, spawnerCharge, namePlates, timedCommands, homeInteractions, signEdit, hpBossBar, launchPad, elytraExploit, afk, holograms, jail, spawners, dynamicSigns, playerChatTag, durabilityLoss, flightCharge, schedule, disabledEnchants, worldLimitsElytra, worldLimits, ranks, firstJoinMessages, silentChest, warmup, totemBehavior
--------------------------------------------------

Errors

Expected whitespace to end one argument, but found trailing data

Relevant Config Sections

No response

Relevant Plugins

No response

Agreements

CloudeLecaw commented 10 months ago

yoi used wrong format check in alais.yml that /ctellraw used /cmi ctellraw and nit tbe vanilla format. your vanilla ctellraw has false content. \n only works for the cmi content

use it like this

cmi ctellraw all <T>Line1\nline2</T><H>Click here\nfor cool things</H><URL>https://www.google.com</URL>

for the ither command look for a good generator and use minecraft:ctellraw and know that \n doesn work in it. (its not a cmi thing at least)

to see how the cmi syntax works look here

https://www.zrips.net/cmi/custom-text/

command is:

cmi ctellraw [playerName/all] [formattedMessage]

if its e enabled in alais.yml you can also use /ctellraw and need to use minecraft:ctellraw to use the old one.