Everything posted by Salatosik
-
Problem with VS Code development
Thanks!
-
Problem with VS Code development
Hello! I need to launch the minecraft client as it is easily done on Intelij idea. I wrote a command for gradlew to create a launch configuration but nothing happened, although VS Code itself built the mod on its own
-
Help with issuing an item
Thanks, I'll try
-
Help with issuing an item
Hello! I need to issue a random item, the first thing that came to my mind was to create an array with ItemStack, I didn’t like the idea because I think that there is a method for issuing a player that accepts an item ID
-
Hostile mob check
Thanks you for your support!
-
Hostile mob check
Sorry, posted the question in English. I often use a translator because I don't know well. Apparently it happened a bug and I copied and pasted the text out of fright. I will not deviate from the topic, if you can help please help I will be grateful
-
Hostile mob check
SORRY! Upd: Hi there! I have an event that defines a method that always works when a player kills any mob. My question: how can I make it possible to compare the alleged appearance of mobs? The example is hostile, harmless. Just in case, I’ll write that I use 1.16.1 and switched recently, approximately after I received a warning from the moderator XD
-
Hostile mob check
Гей! У мене є подія, в якій визначено метод, який завжди працює, коли гравець вбиває будь-якого моба. Моє запитання: як мені зробити можливим порівняти нібито зовнішність мобів? Приклад ворожий, нешкідливий. Just in case, I’ll write that I use 1.16.1 and switched recently, approximately after I received a warning from the moderator XD
-
I'm trying to find out in which slot the player holds the item I need, but nothing happens
@Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) { for(int i = 0; i < entityPlayer.inventory.mainInventory.length; i++) { if(entityPlayer.inventory.mainInventory[i].getItem().equals(this)) { entityPlayer.inventory.setInventorySlotContents(i, null); // removing the first available bag of resources entityPlayer.inventory.setInventorySlotContents(i, new ItemStack(RandomItems.giveItemForPlayer(RandomItems.LEGENDARY_ITEMS))); break; } } return super.onItemRightClick(itemStack, world, entityPlayer); } A huge disadvantage is that if the player actually keeps the bag at the end of the inventory (by index) and if on the way to the end of the inventory the loop encounters the same bag, it will replace the name of the first hit
-
I'm trying to find out in which slot the player holds the item I need, but nothing happens
Hello! I created a method that fires when the player right clicks on an item. My problem is that I need to find out in which slot the player is holding this item.
IPS spam blocked by CleanTalk.