Issue when comparing [Get display name of provided entity] with user entry (from command)

Started by Lix_DansSonLabo on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 08:01, 14. Jun 2020
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Issue when comparing [Get display name of provided entity] with user entry (from command)

Hello !

I'm quite new with MCreator and I'm working on a tabletop plugin for roleplay game.

I'm using 2020-2 because I'm stuck with 1.12.2 mods that are not yet migrated to 1.15...

 

I'm having an issue with the block "Get display name of provided entity" which has a very strange behaviours.

It seems there is un issue with the value returned by this block.

 

Case 1 :

For instance, I'm "Player123" which is 9 char. Making a print shows of the lenght of "Get display name of provided entity" show 11 char long.

Case 2 :

I created a command to set a global string var et set it a Player name in it.

When I compare this string to the one of Case 1, it's different. As long as it's not the same lenght, i understand, even if i don't know why Case 1 returned 11 char long string.

When I substring Case1 returned value to get "Player123", it gives me "Player123" with 9 char string, but comparing whit the global string variable I set with my manual command, comparison return false.

Case 3 :

I created an item to allow user to set himself this global variable using the block "Get display name of provided entity" and it works fine.

But it's not the way I want to do this as long as, as a Game Master, I want to be able to be the only one to set the player name in this variable.

 

 

As I'm a C# dev and I'm not used to Java, I'm not very used to how all of this works. (reason I'm using your awesome tool).

Btw, please don't ask me to update 2020-3 because I'm can't upgrade to MC 1.14 or 1.15 right now.

 

Picture of String comparison : https://ibb.co/brkcvRq

Setting the global string var :https://ibb.co/XkVwPsw

 

Thks in advance for your kind help

Lix

 

PS : i know i repost it from [Help with MCreator software] but it was the wrong forum and I didnt find any way to move it.