Custom Coding: How to Give items to players and how to input variables as strings.

Started by Yosh on Mon, 10/05/2015 - 23:42
Last seen on 19:34, 7. Nov 2017
Joined May 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Custom Coding: How to Give items to players and how to input variables as strings.
Mon, 10/05/2015 - 23:57 (edited)

First things first, I need to know how to give someone something with cuustom code using the items ID.

Example: Give someone a stone block, but using the ID 1 not minecraft:stone

Example: Give someone a command block, but using the ID 137 not minecraft:command_block

If possible I would like the code to look something like this, but in programming languages:

add ID to inventory

 

Next:

How do you make a variable a string in custom code, like if ID (above) was represented by the number variable n?

soooo...

add n to inventory

 

Anyway, erm, I can code BASIC, but that won't get me anywhere, soo... help?

P.S., if this is in the wrong section, please notify me.

P.P.S., you might as well just give the code for the example above.

P.P.P.S. and could there be one making the variable into damage for an item?

Edited by Yosh on Mon, 10/05/2015 - 23:57