Minecraft Spigot Programmers: Give Items To Players?

Pa
6

I came up with a command to have a rewards system that only works on a daily basis with the daily I got it! But now I wanted to give the player an item but when I send. Eingebe and search the list (Eclipse) I find there's nothing to give items unfortunately I found nothing in Google Please help!

Te

There are tutorials on youtube

Ka

You have to cast the station to the player. Then there's the method .setinventory or something like that.

Bi

First ask if the sender is a player, then caster the transmitter to the player so that the underlined way goes.

To set the item: p.getInventory (). SetItem (slotnumber, ItemStack) or .addItem (ItemStack);

Pa

Thank you

Sh

You can also "get" the inventory from the target and then simply use "p.getItemInHand ()".

So I do that z.b. Mostly

Li

P.getInventory (). SetItem (slotnumber, new ItemStack (Material.MATERIAL)); as far as I know