Jump to content

McDogerts

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by McDogerts

  1. I was just posting was I tried and saw that worked. You can see that I posted in the original post literally the only difference between the method that i said was working and the one that wasn't is that the working was set as a static method. When I set the LogsDropDirt method to static it worked. A custom block I have added in was not set as a static method and worked just fine. This is why I said the event will only work for ME in this fashion. Not that this is how it works in all cases.
  2. Comment just to post what I changed. Because I wasted 4 hours on this. The @Subscribe event will only work for me if I make a static method with existing Minecraft Blocks. Custom blocks I've added in do not need to be set as a static method. This was the only difference why the leaves drop worked and the dirt drop did not.
  3. Trying to use a HarvestDropsEvent to change the drops of logs. Was just trying to change the block drop dirt instead of logs. My event is registered. I registered the entire class where a few other events I was testing were placed. I used a similar method to make leaves drop cobblestone in the same class and that works fine. The problem I'm running into with logs is that the log block is still dropped and no dirt block is dropped. @SubscribeEvent public void LogsDropDirt(HarvestDropsEvent event) { if(event.getHarvester() == null) { if(event.getState().getBlock() instanceof BlockLog) { event.getDrops().clear(); event.getDrops().add(new ItemStack(Blocks.DIRT)); } } } https://pastebin.com/igx5fy17 I've also tried it without the first if statement. That does not work either. Is there a better method to change block drops or is there something missing? @SubscribeEvent public void LogsDropDirt(HarvestDropsEvent event) { if(event.getState().getBlock() instanceof BlockLog) { event.getDrops().clear(); event.getDrops().add(new ItemStack(Blocks.DIRT, 1)); } } https://pastebin.com/rRUngcjL Here is the leaves dropping cobblestone I used, that worked just fine, for reference. @SubscribeEvent public static void DropLeaf(HarvestDropsEvent event) { if(event.getState().getBlock() instanceof BlockLeaves) { event.getDrops().add(new ItemStack(Blocks.COBBLESTONE)); } } https://pastebin.com/DLLGbEa5
×
×
  • Create New...

Important Information

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