Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Daeruin

  1. I'm trying to write some tutorial/advice articles for Minecraft modding for 1.16. I'm a technical writer and have a few of my own mods under my belt. I've seen some older tutorials that tell you to add the path of your Java JDK installation to your environment variables. I don't recall having to do that when I started modding, and my general understanding is that the environment variables are mostly a convenience so you don't have to use the full path of an exe on the command line. So I was wondering if you really need to do anything with environment variables for modding and if so what situations it might be needed. Does it depend on your OS, JDK version, IDE, or what? TIA.
  2. Become very proficient with Java. Unfortunately, the state of Forge documentation and lack of up to date tutorials means that you must become very good at reading and understanding other people's code in order to figure things out. You might try looking up TheGreyGhost's Minecraft by Example or Cadiboo's tutorials. They at least go up to 1.15. I haven't been plugged into the modding world for a while, so there may be others I'm not aware of.
  3. Thanks, that's what I needed to know and it's quite simple.
  4. No. What I'm asking for just the normal setup for working with multiple versions of Forge. It's probably something super simple. But I've only ever made one mod for one version of Minecraft. And this is my first time using IntelliJ for anything. Say I switch to my git branch for 1.16. My local repo now has all my 1.16 code for my mod. But IntelliJ doesn't know that. My existing project in IntelliJ still has some old version of Forge loaded. Now what?
  5. I know how to use git and branches. How do I make multiple versions of the Minecraft source code available in IntelliJ?
  6. How do you maintain multiple versions of your mod? I want to be able to do bug fixes for mods I released for older versions of Minecraft while still developing new mods for 1.16. I'm using IntelliJ and I don't know how to set up my projects to accomplish this.
  7. I'm talking about an item, not a block. I didn't want to have to make a whole 3D item model. That wouldn't save me any time. I'm wanting to use the built-in item rendering, but just using a portion of an existing texture image.
  8. I have an item with three sizes. Is it possible to use just one texture for all three, and specify which part of the texture file to use? So the large would use the entire texture, the medium would use a 10x10 portion of the texture, and the small would use 6x6. I know the item model supports the use of elements, and you can set uv coordinates for the elements, but I'm not sure how exactly I would use that in this case, or if it's even possible. I can't think of any examples to look at. TIA.
  9. Thank you for the reply. Does using RenderTypeLookup#setRenderLayer do the same thing as Block#getRenderLayer used to do? Or are they different things?
  10. I'm planning to create 12 blocks, each with 3 sizes and 16 color variations, and I don't want to have to create hundreds of texture files to support all the variations. Each of the 12 blocks will have its own base texture that I want to just tint with another color. I have created an IBlockColor and successfully used it to change the color of the blocks, but the end result isn't good enough. For example, when I color some of the base textures with a dark blue, it basically ends up being black. I would like it to merely be tinted blue. I can achieve a slightly better color for those blocks by using a lighter shade of blue, but then the other blocks are too pale. I don't want to have to find a unique, perfect color for hundreds of blocks by trial and error. Playing around in Photoshop, I can consistently get the effect I want by putting a colored layer with like 40% opacity over top of each texture. Is there a way to achieve this kind of effect in Minecraft?
  11. My solution is different from what the others are talking about. See Jabelar's tutorial on conditional recipes and follow the link he gives to Choonster's TestMod3 example. It's all laid out there. The basic idea is that you create a class that implements IConditionFactory to return true or false based on some value in your config file. Then you create a _factories file in your recipes folder. Then you add the condition into the recipe's json file. This is all for 1.12.2. I haven't looked at newer versions and don't know if it works the same. What version are you working with?
  12. It seem like you could also have two versions of the recipe with conditions that check the config value to determine which recipe to load.
  13. There have to be a dozen different posts here about how to add advancements. Can't be that hard to find.
  14. You are right. I had forgotten about that. There are a handful of methods you can override to get custom control over the EntityItem created by a specific Item: hasCustomEntity, createEntity, onEntityItemUpdate, and getEntityLifespan. You would override hasCustomEntity to return true, then override createEntity to supply your custom EntityItem.
  15. After creating your custom EntityItem class, you would subscribe to EntityJoinWorldEvent and replace the entity with your custom one. I think this post ended up doing that:
  16. I have a custom recipe that is conditional based on a setting in my mod's config. Depending on how the user sets up the config, the recipe may or may not be available. I also have an advancement for the recipe, so it automatically gets added to the user's recipe book when they get the appropriate items. This causes an error when the recipe is turned off in the config, because the advancement doesn't recognize the recipe. Is there some way to make the advancement conditional, as well? Or another way to deal with the issue?
  17. Found the problem. I was mixing up slot index with slot number (for like the tenth time). Slot indexes start over for each inventory, but slot numbers are continuous across inventories (like a chest inventory and survival inventory). I also made my code a little more efficient by only searching the player's inventory, since that's where I don't want items to end up. Here's the final code, for anyone who's interested.
  18. Alright, I found something that seems to be working: EntityPlayerMP player = (EntityPlayerMP)event.getEntityPlayer(); player.dropItem(stackInSlot, false); // Spawns the EntityItem player.inventoryContainer.putStackInSlot(i, ItemStack.EMPTY); player.sendContainerToPlayer(player.inventoryContainer); This only works in my regular survival inventory so far (placing item in the 4x4 crafting grid and closing it with hot bar full so item is forced to go into my regular inventory). If I do it with a crafting table, there seems to be something wrong with my slot indexes, because I'm getting two copies of the item, with one of them in a slot I don't expect. I'll try to figure out that problem tomorrow.
  19. Latest code: @SubscribeEvent public void onContainerClosed(PlayerContainerEvent.Close event) { Container container = event.getContainer(); List<Slot> slotList = container.inventorySlots; for (int i = 0; i < slotList.size(); i++) { Slot slot = container.inventorySlots.get(i); IInventory inventoryForSlot = slot.inventory; if (inventoryForSlot instanceof InventoryPlayer && slot.getSlotIndex() > 8) // I think this guarantees the slot is NOT in the hot bar { ItemStack stackInSlot = slot.getStack().copy(); if (stackInSlot.getItem() instanceof ItemBlockBasket) { event.getEntityPlayer().dropItem(stackInSlot, false); // Spawns the EntityItem event.getEntityPlayer().inventory.setInventorySlotContents(slot.getSlotIndex(), ItemStack.EMPTY); event.getEntityPlayer().inventoryContainer.detectAndSendChanges(); } } } }
  20. I did this: event.getEntityPlayer().inventoryContainer.detectAndSendChanges(); event.getEntityPlayer().openContainer.detectAndSendChanges(); No dice. When I open my inventory, the item still appears to be there, but if I try to click on it, it immediately disappears. If I open another container, like the crafting table, the item disappears.
  21. I didn't originally post any code, because I was asking about ideas for something I hadn't written code for yet. I have since attempted something. This is my current attempt to remove my block from the regular inventory after closing the crafting table container. The only problem is that removing the item from the slot doesn't get synced to the client. Current working code that prevents my block from being placed in the regular inventory via mouse clicks or keyboard.
  22. I have a block that should only be allowed in the player's hot bar--not their regular inventory slots and not in other containers. So far I have been using GuiScreenEvent to detect the various mouse clicks and keyboard shortcuts that move items around. It's working except one scenario. If the player puts the block in the crafting grid, fills up their hot bar, then closes the crafting GUI with the block still in the crafting grid--the block automatically gets put into their regular inventory (assuming they have empty slots there). How can I detect this situation? I've been hoping to avoid the need to loop through every player's inventory every tick to search for the block.
  23. There are a number of posts here on how to remove vanilla recipes in 1.12. Take five minutes to search.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.