How to change id value of item by lua script?

I want to change item`s id value by lua script.

example,

Add two item on json file.

Item1s id is "test", and item2s id is “test_on.”

Ok. I write lua script like below.

function test_off()
type = game.item_type(item)
type["id"] = type["id"] + "_on"

end

game.register_iuse(“TESTOFF”, test_off)

but, this script didn`t work.

How to change id value of item by lua script?

Pretty sure there’s no way to toggle the id like that.
It looks like you’re trying to activate or deactivate an item though, which might be possible, I’ll poke around and get back to you.

Just checking in for Lagnas, and also wondering if lua is still supported? I remember hearing that it would only be supported as long as it was easy to maintain compatibility with previous versions.

BevapDin has brushed up the lua support quite a bit, though a lot more functionality needs to be wrapped by lua in order to make the lua support useful. Best way to help is to try to code something in lua and ask for things that are missing to be added.