Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MCArTyR

Members
  • Joined

  • Last visited

Everything posted by MCArTyR

  1. I read what needs to be done like this: private void setup(final FMLCommonSetupEvent event){ DefferedWorkQueue.runLater(() -> { GlobalEntityTypeAttributes.put(...); }); } But due to deprecation warnings, I did this: @SubscribeEvent public static void onEntityAttributeCreation(EntityAttributeCreationEvent event){ event.put(RegistryHandler.FROG_ENTITY.get(), FrogEntity.setCustomAttributes().build()); } My error: java.lang.NullPointerException: Cannot invoke "net.minecraft.entity.ai.attributes.AttributeModifierMap.getValue(net.minecraft.entity.ai.attributes.Attribute)" because "this.supplier" is null at net.minecraft.entity.ai.attributes.AttributeModifierManager.getValue(AttributeModifierManager.java:67) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.LivingEntity.getAttributeValue(LivingEntity.java:1729) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.LivingEntity.getMaxHealth(LivingEntity.java:1509) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.MobEntity.<init>(MobEntity.java:108) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.CreatureEntity.<init>(CreatureEntity.java:13) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.AgeableEntity.<init>(AgeableEntity.java:21) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.passive.AnimalEntity.<init>(AnimalEntity.java:37) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at me.mcartyr.tutorial.entities.FrogEntity.<init>(FrogEntity.java:31) ~[main/:?] {re:classloading} How to fix it?
  2. Thank you. It works now.
  3. What class is this method from? UPD: Found.
  4. I want to make it so that when the chestplate is on, the player can fly. Here is my code: @SubscribeEvent public static void onEquipmentChange(LivingEquipmentChangeEvent event){ if (!(event.getEntity() instanceof PlayerEntity)) return; PlayerEntity player = (PlayerEntity) event.getEntity(); if(player.isCreative()) return; if(event.getSlot().equals(EquipmentSlotType.CHEST)){ Item item = event.getTo().getItem(); if(event.getFrom().getItem().equals(RegistryHandler.RUBY_CHESTPLATE.get())){ player.abilities.mayfly = false; } if(item != null && item.equals(RegistryHandler.RUBY_CHESTPLATE.get())){ player.abilities.mayfly = true; } } } But the player still cannot fly.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.