#Convert a item
1 messages · Page 1 of 1 (latest)
/replaceitem command would do the job
NEVER use command with scripting
ItemStack.amount -= 1
Basically you re removing 1 item from the stack
I understand that it's highly not reccomended, but is it really that deep?
Basically you re refusing to learn script api, resulting in bad scripts and sometimes in doing non-efficient things like those 200 words long /execute commands
And also you re doing double the work
You can ask everyone that knows scripts of commands are worth to use and you will always get the anseer “use them unless there isn’t a way to do so in script api”
Oh, I just meant with replaceitem specifically
I understand something like the execute command is quite inefficient
Or summon, playanimation etc especially
I just havent bothered to look for a better alternative for use of replaceitem
That's the equivalent, and for what he needs it it can be edted just a little do do what he wants
const inv = player.getComponent("inventory").container
for (let i = 0; i < inv.size; i++) {
if (inv.getItem(i)?.typeId == "minecraft:diamond")
inv.setItem(i, null)
}
👀
Is there an alternative for the lock_in_inventory and lock_in_slot NBT data?
what's that
Cause thats literally the only reason for every time I ever use replaceite
ItemStack actually provides more functionality than /replaceitem or /give, but it just doesn't have a "data" field.
you mean the
as for the question... well just use setEquipment or setItem?
what was that
Thank you
I always forget that ItemStack is a class
uh
just write undefined
entity.setItem(0, undefined)
0 is the slot
undefined is the item.
😭
think yall are overcomplicating it
u should still do it for things script doesnt have yet like infinite effects
could u just use air instead of undefined?
dont think so u have to put undefined
ah
i think u can put air
no u cant
both work
air is air tho
💀
it still sets item
u dont understand 😭 air isnt an item
air is the absence of an item
so set item to air
it doesnt show up in the mincraftitemtypes, so I'm geussing it wont work
it still works
air isnt an item
have u tryed it?
no it isnt u cant just do new Itemstack('minecraft:air', 1)
just put undefined 😠 GRRRR
I was js showing that it don't show up lol
ik ik lmao
silly billy if u hadnt defined air it was undefined
having the same value of undefined
i said both work
-_- bruh yk what ur sayying
ur sayying u can put undefined or any thing u want
aslong as it isnt defined
?
im sayying IS U PUT AIR there will be tons of error messages
SAYYING it isnt defined but has the same value
end of conversation
no there wouldnt be
GRRR 😠 the problem here is solved no more argueing
u can replaceitem with air
bRUh
therE IS NO AIR IN SCRIPT
yea u can
const air = new ItemStack("minecraft:air", 1)
inventory.container.setItem(3, air);
exactly
and that is?
and it works right
no it doesnt
💀 Bruh traye dont talk if u dont know
tbf it makes sense
wrong information is worse than no information
it worked for me
when?
no more argueing
lets just say that it got changed
in a newer update
...
icba the problem here is solved

lets see
dude it does work its just bugged
the item turns ghost
item
so it dont work
it dods
turning it into a ghost item doesnt help
I just did it and it did nothing
check the itme u set it to
it just looks like it did nothing
but if u try dropping item

it wont appear
what is ur ego that u cant except to use undefined
it don't.
undefined is better, since it leaves less possibility for error
-_- didnt i tell u that EARLIER
leme pull up sth
whats the point?
there are no error messsges
and u proved that point here
it is just buggy
😭
Watch Untitled by IzTheKnight0 and millions of other Minecraft videos on Medal. Tags: #minecraft, #openworld
this dose not mean it works
but thats not the point
air ItemStack exists
it doesnt
leme add sth c.setItem(0) is my preference
^
it does
see
leagal??
unrecommended
ye...
just go with yer preference
atleast thats viable
air item is like a zombie ItemStack
whats the weight property even for?
that's true but if you can avoid it: avoid it
you re not getting what the guy from the post wants
was that really that deep?