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

FenrisFox86

Members
  • Content Count

    22
  • Joined

  • Last visited

Community Reputation

2 Neutral

About FenrisFox86

  • Rank
    Tree Puncher

Converted

  • Personal Text
    Just Donuts!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Cy4 made a good video on this topic: I hope this helps you.
  2. Ah thanks! That's even more useful simple customisation options than I expected.
  3. I'm creating a Mod that contains a Lot of new Enchantments, some of which are treasure enchantments. And as everybody knows, Villagers also trade with treasure enchants and that is one of the fastest ways to get your hands on a mending book. Since enchantment generation in the Enchanting Table is automatically done by the game without having to create something like a "enchantment recipe", I started asking myself if my Enchantments are also automatically applied to dungeon loot, Villager Trades and Fishing outputs. That would save me a lot of work.
  4. I now solved it using Attribute Modifiers as Luis_ST suggested. this is my implementation: @SubscribeEvent public static void onLivingArmorEquip(LivingEquipmentChangeEvent event) { if (!event.getEntityLiving().getEntityWorld().isRemote()) { LivingEntity living = event.getEntityLiving(); living.getAttributeManager().createInstanceIfAbsent(Attributes.MOVEMENT_SPEED); ModifiableAttributeInstance attribute = living.getAttribute(Attributes.MOVEMENT_SPEED); for (AttributeModifier modifier : attribute.getModifierListCopy()) {
  5. @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.side == LogicalSide.CLIENT) { event.player.abilities.setWalkSpeed(1f); event.player.sendPlayerAbilities(); } } I already tried this. Just as in the code shown in my second example, the setWalkSpeed method call doesn't work when I add this line of code.
  6. Uhmm... Sorry, but I can't find any method like that. Am I just bein' stupid right now?
  7. I'm trying to make a set of armor that makes the player 50% faster for every armor piece they're wearing. But first I needed to be able to change the player's speed in general. So I made a simple event handler that speeds the player up every tick: @OnlyIn(Dist.CLIENT) @SubscribeEvent public static void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.side == LogicalSide.CLIENT) { event.player.abilities.setWalkSpeed(1f); } } This works and it gives the player an insane speed boost without any conditions. What's confusing me is that Player
  8. Solved: Thank you for your patient help. It works now and believe me, the satisfaction of having a diamond pop out of a grass block after hours of making stupid mistakes is way greater than the satisfaction of just finding a Diamond in survival . This is the final class for registry: package com.FenrisFox86.fenriscore.common.events; import ... @Mod.EventBusSubscriber(modid = FenrisCore.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class LootModifierEvents { @SubscribeEvent public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<G
  9. So I moved that to a new class that is registered to the event bus. The error stays the same. package com.FenrisFox86.fenriscore.common.events; import ... @Mod.EventBusSubscriber public class LootModifierEvents { @SubscribeEvent public void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) { event.getRegistry().register(new CrusherModifier.Serializer().setRegistryName( new ResourceLocation(FenrisCore.MOD_ID,"crush_drop"))); } }
  10. Well here you have it. I'm just not too sure if this is helpful since its just the mod's core class. package com.FenrisFox86.fenriscore; import ... // The value here should match an entry in the META-INF/mods.toml file @Mod("fenriscore") public class FenrisCore { private static final Logger LOGGER = LogManager.getLogger(); public static final String MOD_ID = "fenriscore"; public FenrisCore() { // Register the setup and doClientStuff methods for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingCont
  11. So this code snipped here is probably wrong. But how do I register the Serializer if not like this? @SubscribeEvent public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) { event.getRegistry().register(new CrusherModifier.Serializer().setRegistryName( new ResourceLocation(MOD_ID,"crush_drop"))); }
  12. Oh, I just found a related Error in the log. It couldn't parse the loot modifier. Does that mean that it didn't find the file at all or that I did something wrong inside the file? I think it's rather less probable that the file itsself is written the wrong way. I pretty much copied it from the docs. [16:45:17] [Render thread/ERROR] [ne.mi.co.lo.LootModifierManager/]: Couldn't parse loot modifier fenriscore:crush_drop java.lang.NullPointerException: null at net.minecraftforge.common.loot.LootModifierManager.deserializeModifier(LootModifierManager.java:139) ~[forge-1.16.4-35.1
  13. Yes, I used shears. And no, I don't actively call the serializer. I thought that the serializer is automatically called when a loot drop is performed.
  14. I'm working on a Mod that introduces quite a couple of new tools to the game and right now I'm working on a Hammer that's pretty similar to the one from Ex Nihilo if this is still a thing. It can destroy the same blocks as a Pickaxe but as soon as it causes a loot drop, it will replace certain Items. Cobblestone will turn into gravel for example. So first I need to understand the basics about Loot Modification. I read the docs and to get an understanding of how it works, I first just copied the code out of the forge docs and tested it. Of course it didn't work. My problem right now
  15. Just something important for people trying to do a similar thing: normalize the vector and then multiply it by a factor you need. Otherways the vector's going to be as long as the player's distance to the block they're facing so the dash won't have a consistent length. Vector3d vector = player.getLookVec().normalize().mul(factor, factor, factor); player.setMotion(vector);
×
×
  • Create New...

Important Information

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