This is the final result Im aiming to get:
ItemStack block = new ItemStack(Block.dirt, 1);
And this is what I have
String s = "Block.dirt";
ItemStack block = new ItemStack( , 1);
It kinda looks impossible, but is there a way to turn the string "Block.dirt" into Block.dirt?
I tried many things, some people suggested me to use GroovyShell and Binding but I cannot do that.
Is there a way to name a object from a string?
Any help is highly appreciated. Thank you.
Can I have an example?