Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Message effect can have double evaluation of its message content

Open TPGamesNL opened this issue 3 years ago • 0 comments

Skript/Server Version

Skript 2.6.3, Paper 1.19

Bug Description

Using the message effect with both a player and console as receivers, and the message content being a VariableString (or formatted expression), the VariableString will be evaluted twice, resulting in for example a function in it being called twice.

Expected Behavior

To only call the VariableString getter once.

Steps to Reproduce

function test() :: number:
	broadcast "func call"
	return 2

command /test:
	trigger:
		message "abc %test()%" to console and all players

Run /test, with at least one player online. Function is called twice

Errors or Screenshots

No response

Other

Fixing this would likely require some more API, as we'd need to be able to convert a list of MessageComponents back to text, which we don't have any methods for AFAIK

Agreement

  • [X] I have read the guidelines above and affirm I am following them with this report.

TPGamesNL avatar Jul 24 '22 20:07 TPGamesNL