• 0

    posted a message on Events on 1.12.2?

    If you have the forge source code, the events can be found in the event and client.event packages.

    Posted in: Modification Development
  • 0

    posted a message on A texture for my minecraft mod wont load

    It isn't loading the model, make sure the model json is in assets/<yourmodid>/models/item.

    Posted in: Modification Development
  • 0

    posted a message on How Do You Make Something To Where It Is The Item Model That Is Thrown By The Player?

    In 1.15.2, there is the interface IRendersAsItem which the potion, snowball, egg, and enderpearl implement.

    Posted in: Modification Development
  • 0

    posted a message on How to create a functional block like a crafting table

    You need to check if the items are in the correct slots and then if they are, get the output. In the ContainerRepair class, this is how it is done:

    In the constructor:


            this.inputSlots = new InventoryBasic("Repair", true, 2)
            {
                public void markDirty()
                {
                    super.markDirty();
                    ContainerRepair.this.onCraftMatrixChanged(this);
                }
            };

    onCraftMatrixChanged:


        public void onCraftMatrixChanged(IInventory inventoryIn)
        {
            super.onCraftMatrixChanged(inventoryIn);
    
            if (inventoryIn == this.inputSlots)
            {
                this.updateRepairOutput();
            }
        }

    Where updateRepairOutput is the method that checks the input slots and then puts the output in the output slot.

    Posted in: Modification Development
  • 0

    posted a message on Trying to make a custom potion do something specific

    This can be done with events. Just use LivingHurtEvent and alter the damage values if the defending/attacking entity has the effect and the other entity is a wolf.

    Posted in: Modification Development
  • 0

    posted a message on How to create a functional block like a crafting table
    !this.mergeItemStack(itemstack1, 10, 46, true)

    Your container only has 39 slots (30-38 are the hotbar, 3-29 are the rest of the player inventory, 0 and 1 are input slots, and 2 is the output slot). I suspect that it crashes because it looks in slots that do not exist. It won't do that with a sword because the sword doesn't look for stacks to merge with. What you want to do is probably check if the item has a max stack size of one and then try to merge it in the first input slot, and otherwise try to merge it in the second input slot.


    I would recommend looking at the ContainerRepair class, specifically the transferStackInSlot method.


    I would also recommend overriding isItemValid for your output slot and returning false, so that you can't put items in the output slot, along with overriding onTake to remove the items in the input slots (a good example is also in the ContainerRepair class).

    Posted in: Modification Development
  • 0

    posted a message on uncrafting table for 1.15+

    I'm planning on putting it on github soon. The only bug I've found so far is when you shift click the stack in the input slot it appears to duplicate it, however this only happens on the render thread, so it isn't actually duplicated. I think I know why this happens, I had to run the uncrafting code in two different places (one that only runs on the server and one that only runs on the client, and I believe this is because the server tells the client that the items are gone from the slot and in another slot but then the client tries to run the uncrafting code again, and it thinks that the items are still in the input slot.


    Just wanted to add is that I think I know how to fix the bug. It's because I did a dumb workaround since I forgot the proper way to update things on the server and client at the same time. If I do it the proper way then the bug should be fixed.

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Uncrafting Table
    Uncrafting Table

    This mod can be downloaded here (curse forge).

    This mod was made for this request: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/requests-ideas-for-mods/3030674-uncrafting-table-for-1-15

    This mod adds an uncrafting table.

    It is crafted with 8 blocks of iron and a crafting table.

    You put the item you want to uncraft in the left slot and it will delete the item and output the materials it is crafted from in the right slots.


    Like this, except I put another diamond pickaxe in the left slot (it will be converted to diamonds and sticks if the items are removed from the right slots.

    It should be noted that only items with zero durability can be uncrafted, so partially broken tools cannot be uncrafted.


    I will post the code on github in a few days.


    I will add a link to the curse forge download once the project is approved.


    Known Bugs:


    Visual Glitch when shift clicking an item from the input slot.


    Plans for future updates:


    Allowing the player to choose between what they would like to uncraft the input to.

    Adding a button for uncrafting the input.

    Adding config options (such as making the uncrafting take experience)

    Posted in: WIP Mods
  • 0

    posted a message on uncrafting table for 1.15+

    Alright, I finished it (it's still a bit buggy). It took a bit longer than I expected.


    The forum post is: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/wip-mods/3032965-uncrafting-table

    The curse forge project is: https://www.curseforge.com/minecraft/mc-mods/uncrafting-table

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on uncrafting table for 1.15+

    This doesn't seem that challenging to make. I may work on this later.

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on How to create a functional block like a crafting table

    I would recommend looking at the anvil code in 1.12.2 and then gutting it to turn it into your container rather than doing the smithing table in 1.16 because a lot of things change between versions.

    Quote from johan2403


    I created the block, the tile entity, the container, GUI class and GUI Proxy (ie. GUIHandler).



    You don't need a tile entity if you do not need to store extra data in the block (such as the itemstacks of a chest).

    Quote from johan2403»



    The item tool tips are not showing, when I close the inventory of the block the items that I put in don't come back to my inventory,

    the items are being stored in the container, if I break the block Items don't drop.






    1. Make sure you have

    this.renderHoveredToolTip(mouseX, mouseY);


    called in draw screen


    2. Make sure you have

        public void onContainerClosed(EntityPlayer playerIn)
        {
            super.onContainerClosed(playerIn);
    
            if (!this.world.isRemote)
            {
                this.clearContainer(playerIn, this.world, this.craftMatrix);
            }
        }


    In your container class, this will cause it to drop all items when you close it.


    3. The items are probably being stored in the tile entity, but there isn't the code to drop the stacks when the block is broken.

    Quote from johan2403»

    And I'm able to put items into the output slot.

    How can I disable that?



    You need to override isItemValid and return false.

    Posted in: Modification Development
  • 0

    posted a message on Preventative Crafting

    Just add a shapeless recipe with blaze powder and an ender pearl to produce air.

    Posted in: Mods Discussion
  • 0

    posted a message on 1.16.1 Question about FillerBlockTypes when generating ores

    For placing ores adjacent to water, I would suggest in the line where the blocks are actually placed in testing if any of the fluids adjacent to the ore are water or flowing water.

    Posted in: Modification Development
  • 0

    posted a message on 1.16.1 Question about FillerBlockTypes when generating ores

    You cannot make another filler block type. If you want ores to generate and replace different blocks, then you'll have to copy the ore feature code and then just replace the FillerBlockType with a way of testing if the ore can generate there. You'll also need to register the feature.

    Quote from t1la»

    Another question I have is how to make an ore to generate only near water sources? If I set the FillerBlockType to WATER the ore would presumable generate where water normally does and I want it to generate like normal stone in underground in caves, but only near water (talking about a different ore here).


    Do you mean like adjacent to water or within a few blocks?

    Posted in: Modification Development
  • 0

    posted a message on What should I set the block harvestLevel to to make it breakable by hand?

    Just override the method getDrops (I think this is what it is called), and return an empty list for the drops.

    Posted in: Modification Development
  • To post a comment, please or register a new account.