Stevertus / objD

objD is a framework for developing Datapacks for Minecraft. It uses the Dart programming language.
https://objd.stevertus.com
BSD 2-Clause "Simplified" License
46 stars 13 forks source link

Player Inventory access #23

Closed GamingInfinite closed 3 years ago

GamingInfinite commented 3 years ago

Just to be able to access the player inventory to see if they have a given item, then run a command based on that. If this is already possible please tell me how because I can't tell

Stevertus commented 3 years ago

Yes you can use

If(Entity.Self(nbt: {'Inventory': [Item(Items.stone).getMap()]}))

Yes it might not be obvious, let me know how I can improve it

More resources: https://objd.stevertus.com/basics/#entity It is also explained here in depth: https://www.youtube.com/watch?v=6aS3K3khuYI