blob: d42207d55ed3342b7c4f0f88b7e1db44a369b69b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package los.numeros.utils;
import java.text.AttributedCharacterIterator.Attribute;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.enchantment.UnbreakingEnchantment;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class GiveItem {
public static final int ARMOR_HEAD = 103;
public static final int ARMOR_CHEST = 102;
public static final int ARMOR_LEGS = 101;
public static final int ARMOR_BOOTS = 100;
public static void givePlayerItem(ServerPlayerEntity player, String itemID) {
ItemStack item = new ItemStack(Registry.ITEM.get(new Identifier(itemID)));
player.inventory.insertStack(item);
}
public static ItemStack givePlayerSpecialItem(ServerPlayerEntity player, String itemID) {
ItemStack item = new ItemStack(Registry.ITEM.get(new Identifier(itemID)));
return item;
}
public static void setPlayerSlot(ServerPlayerEntity player, String itemID, int slot) {
ItemStack item = new ItemStack(Registry.ITEM.get(new Identifier(itemID)));
player.equip(slot, item);
}
}
|