Trouble with variables
Mark-van-Dyke opened this issue ยท 4 comments
I'm following the "Young person's guide to Programming in Minecraft". I followed the instructions to execute the command:
/js echo( self, location )
while 'location' was 'Mahon Point'.
But instead of displaying Mahon Point in the chat, it returned
CraftPlayer{name=Acetas} (Acetas is my Minecraft username, in case you wonder)
After that, I tested around for a bit with commands like "/js echo ( self, self.name )" . I also tried the "greet.js" thing mentioned in the "Your first Minecraft Mod" section. I'm sure I did everything correct, but still, when I executed "/js greet(self)" it also just displayed "CraftPlayer{name=Acetas}" .
Long story short, whenever I execute a command that contains a variable like "self" or "player", it returns "CraftPlayer{name=Acetas}" no matter what the actual command is.
Edit: I have tested the above by literally copy-pasting the code from the instruction pages into my Minecraft chat. The result didn't change.
Which version of Java are you using? java -version
Which OS are you using?
Which Modding lib are you using - SpigotMC or CanaryMod?
I'm actually running Scriptcraft on a SERVER, with SpigotMC, Linux and Java 8.
I've tried to reproduce this with Spigot 1.9, Linux and Java 8. I cannot reproduce this issue.