Jump to content

[1.14.4] How to implement custom shears


Overstand

Recommended Posts

hi, can anyone tell me the best way how to implement shears?

the problem with my custom shears is, they dont work on leaves, because the loot_table needs the minecraft:shears...

I added a tag forge:shears and replaced the "item": "minecraft:shears" with "tag": "forge:shears" and this is working for vanilla leaves.

 

but in biomes o plenty i cant override the loot_tables json, they use the default ones with the minecraft:shears entry. and not the modded version data/biomesoplenty/loot_tables/blocks/ "some_leave_block.json"..

 

i tried to override the loot_table by using the event "LootTableLoadEvent" for the acacia_leaves block like this

@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.FORGE)
public class LootTableLoadEventHandler {
    @SubscribeEvent
    public static void onLootTableLoad(final LootTableLoadEvent event) {
        ResourceLocation resourceLocation = event.getName();
        String modId = resourceLocation.getNamespace();
        String path = resourceLocation.getPath();
        LootTableManager manager = event.getLootTableManager();

        if (modId.equals("minecraft")) {
            if (path.equals("blocks/acacia_leaves")) {
                event.setTable(manager.getLootTableFromLocation(new ResourceLocation(MODID, path)));
            }
        }
    }
}

 i placed the new acacia_leavs.json with the tag entry in the path of my mod (MODID) and i tried some other locations, but now the block drops nothing .... the minecraft:shears isnt working anymore and the modded shears too...

 

and i tried to use the HarvestDropsEvent, but it isnt working....

 

so...

 

what is the best or right way to create shears?

 

 

Link to comment
Share on other sites

1 hour ago, Overstand said:

what is the best or right way to create shears?

It effectively doesn't exist.

 

See this comment:

https://github.com/MinecraftForge/MinecraftForge/pull/5871/#issuecomment-542697064

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.