WingedSeal / jmc

A compiler for JMC (JavaScript-like Minecraft Function), a mcfunction extension language for making Minecraft Datapack
https://jmc.wingedseal.com
MIT License
64 stars 8 forks source link

Add Item.clear built-in function #28

Closed Nico314159 closed 1 year ago

WingedSeal commented 1 year ago

Why is "amount" ANY type? Set the defaults to 1 and check whether it is 1

Nico314159 commented 1 year ago

Why is "amount" ANY type? Set the defaults to 1 and check whether it is 1

That won't be able to distinguish between someone actually inputting 1 and someone leaving off that input. (leaving off the input clears all copies of the specified item not just 1)

Nico314159 commented 1 year ago

I guess I could use -1 for that purpose tho

WingedSeal commented 1 year ago

But there's literally no difference between someone actually inputting 1 and someone leaving off that input.

Nico314159 commented 1 year ago

But there's literally no difference between someone actually inputting 1 and someone leaving off that input.

No, clear @s gold_block and clear @s gold_block 1 do different things. The former removes all gold blocks from inventory, the latter only removes 1 gold block.

WingedSeal commented 1 year ago

Oh right, just use -1 then

Nico314159 commented 1 year ago

Okay I changed it.

WingedSeal commented 1 year ago

I didn't see any change...

Nico314159 commented 1 year ago

I didn't see any change...

I forgot to push 🤦 Fixed now.