• 1

    posted a message on Help with adding attributes to items

    This is in 1.15.2:

    [noparse]public Multimap<String, AttributeModifier> getAttributeModifiers(EquipmentSlotType equipmentSlot) {
    Multimap<String, AttributeModifier> multimap = super.getAttributeModifiers(equipmentSlot);
    if (equipmentSlot == EquipmentSlotType.FEET) {
    multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), "Armor modifier", 1.25, AttributeModifier.Operation.ADDITION));
    }
    return multimap;
    }[/noparse]


    This will add 1.25 attack damage if the item is put in the boots slot. I'm not entirely certain what the UUID does, but it is the one used for armor and toughness for boots in ArmorItem.

    Posted in: Modification Development
  • 1

    posted a message on Help with adding attributes to items

    Override getAttributeModifiers for the item, I would recommend looking at SwordItem to see how it is done.

    Posted in: Modification Development
  • 0

    posted a message on Modify item attack damage

    The issue here is that getAttributeModifiers is called to get the modifiers for the item, so calling it and adding to the list does nothing (it creates a new list each time it is called).

    Posted in: Modification Development
  • 0

    posted a message on How do I create a simple block?

    Do you have the correct json file in the blockstates folder? it should look something like:

    {
        "variants": {
            "normal": { "model": "minecraft:iron_ore" }
        }
    }
    Posted in: Modification Development
  • 0

    posted a message on 1.12.2 Custom mob moves fast enough to bend time.

    You may need to show more code to figure this out (if there is any more that affects your mob, otherwise it might have something to do with the wither skeleton code).


    Also, what is

    {
    
    EntityAIAttackMelee EntityAITarget;
    
    EntityAIBreakDoor EntityAIMoveTowardsTarget;
    
    EntityAINearestAttackableTarget<EntityLivingBase> EntityAISwimming;
    
    }

    this part? it looks like some stuff may be missing here.


    does it move faster just when chasing something or when wandering around?


    Also I don't see why you would need to set it's item in the constructor, since the wither skeleton has this:

        protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
        {
            this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD));
        }

    which is called when it is first spawned.

    Posted in: Modification Development
  • 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
  • To post a comment, please .