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.

Choonster

Moderators

Everything posted by Choonster

  1. I just re-read your post and noticed that you're using a block. Item display transformations are only applied when the model is rendered for an item, they're not applied when the model is rendered for a block in the world. I think you can specify a base TRSRTransformation for a model using Forge's blockstates format. Set the "transform" key of a variant to an object with either a single "matrix" key or some combination of "translation", "rotation", "scale" and/or "post-rotation" keys. You can see a simple example here in RFTools and a slightly more complex example here in a Forge test mod. Look at ForgeBlockStateV1.TRSRDeserializer to see how Forge deserialises TRSRTransformations.
  2. If you look at the model format, you'll see that your display section is incorrect. You need to specify the display transformations for a specific transform type (e.g. thirdperson_righthand, ground).
  3. The game directory is C:\Users\owner\AppData\Roaming\.minecraft, but you've installed mods in C:\Users\owner\Desktop\.minecraft\mods so Forge isn't loading them. Either install mods in C:\Users\owner\AppData\Roaming\.minecraft\mods or change the game directory to C:\Users\owner\Desktop\.minecraft.
  4. That's exactly what vanilla does and what you need to do. They don't need to visible (i.e. you don't need to specify the "display" element in the advancements), they just need to exist.
  5. Override Item#getAttributeModifiers to call the super method, add a movement speed AttributeModifier to the returned Multimap and then return the Multimap. The modifiers in the returned Multimap will automatically be applied to any entity that equips or holds the item. The key of the Multimap is the attribute's name (IAttribute#getName).
  6. WorldServer#getAdvancementManager returns the server world's AdvancementManager. The World#advancementManager field is never used by client worlds, I'm not entirely sure why it's in World rather than WorldServer. Looking into this further, advancements are actually stored in the AdvancementList instance (AdvancementManager.ADVANCEMENT_LIST and ClientAdvancementManager#advancementList). You'll need to use reflection to access the server instance and the internal collections.
  7. If a recipe fails to load, there will be an error in the log explaining why.
  8. You can use the PotionEffect(Potion potionIn, int durationIn, int amplifierIn, boolean ambientIn, boolean showParticlesIn) constructor to control whether or not particles are displayed for a PotionEffect.
  9. Forge automatically loads every recipe file in the assets/<modid>/recipes directory, you don't need to manually register them.
  10. RealmOfTheDragons#onPostInit is never called because it has more than one parameter, there should be a warning in the log telling you this. This means that CommonProxy#onPostInit is never called and your entity is never registered. Proxies are for sided code, common code belongs in your @Mod class (or classes called from it). I recommend using an interface rather than a class as the common type of your proxies (i.e. the type of the @SidedProxy field).
  11. That would work, but EnumFacing.getFront uses the same indexes as EnumFacing.VALUES (because it uses EnumFacing.VALUES), i.e. EnumFacing#getIndex rather than Enum#ordinal. There's also no need to use any index here, you already have the EnumFacing returned by EnumFacing#getOpposite.
  12. I explained that in my first reply. I've also just edited it to include a detail that I forgot (EntityLiving#setEquipmentBasedOnDifficulty needs to be called from EntityLiving#onInitialSpawn).
  13. Why are you using EntityJoinWorldEvent for your own entity? Look at the constructors of the ItemStack class to what parameters they require. You should have your Item and Block instances stored in static fields of a class (usually called something like ModItems/ModBlocks), you can get the instances from these fields to pass to the ItemStack constructor. Do you actually know Java? You need to have a solid understanding of both Java and OO programming in general to a make a mod. This forum isn't for helping people with basic Java issues. Do you ever spawn an EntityMasterJacket?
  14. Use Entity#setItemStackToSlot to set the item in an entity's equipment slot. If the mob should always spawn with this equipment or always has a chance to spawn with it, override EntityLiving#setEquipmentBasedOnDifficulty to set the equipment and then override EntityLiving#onInitialSpawn to call it. If the equipment is specific to the way it's being spawned, set the equipment manually before spawning it. Edit: Forgot to mention that EntityLiving#setEquipmentBasedOnDifficulty needs to be called from EntityLiving#onInitialSpawn.
  15. EnumFacing#getOpposite already returns an EnumFacing, you're getting its ordinal and then looking it up in the EnumFacing.VALUES array to get the same EnumFacing. You don't need to use the EnumFacing.VALUES array here at all. The indexes of EnumFacing.VALUES are the ones returned by EnumFacing#getIndex, not the ones returned by Enum#ordinal. These happen to be the same, but it's more correct to use the same indexes that are used to populate the array. Use EnumFacing.getFront to get an EnumFacing by its index rather than using the EnumFacing.VALUES array directly.
  16. Use EnumFacing#getOpposite to get the opposite facing. Use the EnumFacing.values method or the EnumFacing.VALUES array to get all EnumFacing values.
  17. Forge will load advancements from your mod's assets/<modid>/advancements directory. I don't think there's any way to remove vanilla advancements without messing around with the internals of AdvancementManager.
  18. The name of a SoundEvent isn't the name of the sound file(s) it plays, you need to get the file the same way that the sound system does. First use SoundHandler#getAccessor to get the SoundEventAccessor for the SoundEvent's name (SoundEvent#getSoundName). This is a wrapper around zero or more ISoundEventAccessor objects, each of which could be either another SoundEventAccessor (a sound event) or a Sound (a sound file). Then use SoundEventAccessor#cloneEntry to select a random Sound from the event's list of sound files and Sound#getSoundAsOggLocation to get the path to the sound file (a ResourceLocation). One you have the path, use IResourceManager#getResource to get the IResource and IResource#getInputStream to get the InputStream. If the record has more than one possible file, this will select one at random. To get every possible file, you'd need to access SoundEventAccessor#accessorList via reflection.
  19. It was replaced by RegistryEvent.MissingMappings<T extends IForgeRegistryEntry<T>> in the 1.12 registry overhaul. T is the registry type you want to handle the missing mappings for.
  20. Looking at the methods where C08PacketPlayerBlockPlacement was used (PlayerControllerMP#onPlayerRightClick and PlayerControllerMP#sendUseItem), it's been replaced by CPacketPlayerTryUseItemOnBlock (sent by PlayerControllerMP#processRightClickBlock when the player right clicks a block) and CPacketPlayerTryUseItem (sent by PlayerControllerMP#processRightClick when the player right clicks air). What are you actually trying to do?
  21. I created an armour item that replaces your other armour when equipped and restores it when unequipped here. I created an armour item that deletes itself as soon as it's unequipped here. I use these two classes here and here to create an armour set that's automatically equipped when you equip the helmet.
  22. Blocks should be created and registered before Items. Apart from that, I can't see any obvious problems. What makes you think something is wrong? I highly recommend migrating to registry events, they allow you to register things at the right time without worrying about when that is. This will also make it easier to update to 1.12+, where GameRegistry.register is private. I recommend against having a common proxy; proxies are for sided code, common code belongs in your @Mod class (or classes called from it). I recommend using an interface as the common parent of your proxy classes rather than a common proxy class.
  23. Blocks are created and registered before Items, so you can't pass an Item to a Block constructor. When you create your Block instance, your Item fields haven't been initialised yet; so they still contain null.
  24. Hard drive space is irrelevant, RAM is what you don't have enough of.

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.