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

Triphion

Members
  • Content Count

    116
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Triphion

  • Rank
    Creeper Killer

Recent Profile Visitors

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

  1. Thank you so much! With all my researching I didn't come across LinkedHash anywhere. I feel like Java is harder to find solutions and documentations on. C# has complete docs with references, examples and very detailed explanations and scenarios. Sidenote: Do you know if there are any good docs where I can read up a bit more on Java in general?
  2. Alright, I've researched this since yesterday and I simply cannot figure this out. What do you mean by "mutate" it? What I was thinking was to create a copy of the old multimap, change a few values in there, and then replace the old one. But this doesn't work since i'm getting an unsupportedOperationException: null. Which is confusing since if I cannot remove and add values from the copy I made and replace the old ones, how am I supposed to change the values?
  3. Oh, okay! But i'm still having a hard time understanding how i'm gonna modify the values. I had an old way of doing this, but this doesn't work anymore due to it being an immutable list now. @Override public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlotType slot, ItemStack stack) { final Multimap<Attribute, AttributeModifier> modifiers = super.getAttributeModifiers(slot, stack); if (slot == EquipmentSlotType.MAINHAND && getBurning(stack) == true) { replaceModifier(modifiers, Attributes.ATTACK_DAMAGE, BASE_ATTACK_DAMAGE_UUID, 1.
  4. Alright, thanks! I moved it into my general EventHandler and it seems to work fine now. As a sidenote, I seem to have a hard time understanding the new way of changing attributes. I had a way of changing attributes based on different modes on items. I have an event that fires every time a player presses a certain keybinding, and that works fine. But to add the attributes through the event after the maps got changed to immutable has been quite hard. @SubscribeEvent public static void updateItemAttributes(ItemAttributeModifierEvent event) { Utils.getLogger().info("ItemStackModifierEvent
  5. I was trying to add the ItemAttributeModifierEvent so that I could change values depending on different circumstances. But I ran into a weird error which i've never seen before and I can't really make out what it means. Any help would be appreciated. This is my event handler and main class for reference. public MainClass() { instance = this; final IEventBus modBus = FMLJavaModLoadingContext.get().getModEventBus(); modBus.addListener(this::commonSetup); modBus.addListener(this::clientSetup); modBus.addListener(this::onLoadComplete); EtauricBlocks.BLOCKS.register(mod
  6. Simple question, I started to update my 1.12 mod to 1.16.5 and a whole lot of functions and methods are renamed and reworked. One such function is the addPropertyOverride function. I looked through vanilla code for Bow and Elytra and the call function is not even there. What is the new way of doing propertyOverrides? this.addPropertyOverride(new ResourceLocation(Reference.MODID + ":stalking"), new IItemPropertyGetter() { @Override public float call(ItemStack p_call_1_, World p_call_2_, LivingEntity p_call_3_) { return stalking ? 1.0F : 0.0F; } }); This was h
  7. I've managed to add entities to the mod, but not with spawn eggs and natural spawns. To start off with, I don't know when to add the entity spawns. Secondly, I don't know if my current spawn code actually works since I haven't tried it, but if you see some problem with it, please point that out. And lastly, the spawn eggs. I know how to add a spawn egg, unfortunately, since i'm using deferred registries for the entities etc. the normal "Entitytype.MYENTITY" does not work, and neither does "Entitytype.MYENTITY.get()" nor "RegistryObject.of(Entitytype.MYENTITY.getId(), ForgeRegistries.ENTITIES)"
  8. Thank you! I changed it to a Supplier instead. I'm gonna have to learn how to use these systems so that I can use them more efficiently in the future. Case solved!
  9. Oh? Then how would I pass in a vanilla creature? Since the vanilla creatures are EntityTypes, I don't know how to do that.
  10. I'm sorry, I don't think I follow. If I were to store it like so: public BossItem.BossProperties setBoss(RegistryObject<? extends EntityType<? extends LivingEntity>> boss) { this.boss = boss; return this; } I have to remove this: private EntityType<? extends LivingEntity> boss; public BossItem.BossProperties setBoss(EntityType<? extends LivingEntity> boss) { this.boss = boss; return this; } And change this: private EntityType<? extends LivingEntity> boss; To this: private RegistryObject<? ext
  11. Oh. Well, how would i do that? The registry objects and the suppliers are really new to me so I haven't really figured out how to use them. public static final RegistryObject<Item> TERROR_FEEDER = ITEMS.register("terror_feeder", () -> new BossItem(new BossItem.BossProperties().setBoss(EtauricEntities.CHUPNUT).setTooltip("A food source for a special water beast..."))); RegistryObject<EntityType<EtauricEntities.CHUPNUT>> This is obviously wrong as i've experienced...
  12. Wow. Thanks for telling me, that would have been a great pain for me to figure out by my own. Still, the registry_object is not present remains. This is my current code: public static final RegistryObject<Item> TERROR_FEEDER = ITEMS.register("terror_feeder", () -> new BossItem(new BossItem.BossProperties().setBoss(EtauricEntities.CHUPNUT).setTooltip("A food source for a special water beast..."))); Item register. public class BossItem extends Item { private final String tooltip; private final EntityType<? extends LivingEntity> boss; public BossItem(BossItem.Boss
  13. On the setBoss method. And then it gives me 3 "quick fixes" that all involves I change either the chupnut to livingentity or that the method parameter be changed to chupnutentity.
  14. I'll rephrase; it doesn't give me errors if I specifically say that the <?> is a Chupnut.
  15. Why doesn't this work? public static final RegistryObject<Item> TERROR_FEEDER = ITEMS.register("terror_feeder", () -> new BossItem(new BossItem.BossProperties().setBoss(EtauricEntities.CHUPNUT).setTooltip("A food source for a special water beast..."))); It won't work unless i specifically say that the <?> entity is an entity chupnut... public BossItem.BossProperties setBoss(RegistryObject<EntityType<? extends LivingEntity>> boss) { this.boss = boss.get(); return this; } I assume that this is what you meant by that?
×
×
  • Create New...

Important Information

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