kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

1.20.4: Variables do not properly resolve #2732

Closed sarhatabaot closed 4 days ago

sarhatabaot commented 4 days ago

"/version ChatControlRed" - plugin version

10.27.4

Are you using MySQL?

Yes

Are you using BungeeCord?

No

Error log (if applicable)

https://paste.gg/p/anonymous/6fefcc70fee048da8e354faf57596488

"/chc debug" output (strongly recommended)

Sent via email.

Information about the issue/bug

I have a simple variable, see setup below. When executing via /chc info script sarhatabaot {player_is_op} the result is resolved to "yes" instead of "true".

Type: FORMAT

# The key we look for in the chat surrounded by [] brackets, example:
# chat message: "Hello everyone, I have an [item] in my hand"
Key: player_is_op

# The value the key will be replaced to.
# This uses JavaScript and must return a boolean value.
Value: player.isOp()

# What JavaScript condition must return true for this variable to show?
# You can put variables in here to get replaced.
Sender_Condition: '{sender_is_player}'

# What permission must the message sender have in order for this variable to display to him?
Sender_Permission: ''

# See Sender_Condition, except that we evaluate the JavaScript for each chat message receiver
# and only show the message to those receivers for which the condition returns true.
Receiver_Condition: ''

# What permission must the message receiver have in order for this variable to display to them?
Receiver_Permission: ''
kangarko commented 4 days ago

The /chc info is more ridig, but it should work in chat or formats.

If it won't, use "player.isOp() ? true : false" or force string with "player.isOp() ? 'true' : 'false'"

sarhatabaot commented 4 days ago

Please review the logs I sent. It does not work in the chat... Also, I tried doing this: "player.isOp() ? true : false" or force string with "player.isOp() ? 'true' : 'false'"

Same result.

sarhatabaot commented 4 days ago

For reference, here I'm sending a test message: javaw_RAqVAtLr8J

And here is the corresponding error: https://paste.gg/p/anonymous/61f80ecc4c4a4c0d9893989234bf7401

sarhatabaot commented 4 days ago

Guessing this is actually a conflict with another plugin somewhere..

sarhatabaot commented 4 days ago

Turns out it was a conflict with PAPI's player expansion. Sorted.