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
  • Joined

  • Last visited

Everything posted by Choonster

  1. I would highly recommend using an actual IDE with a graphical debugger like IDEA or Eclipse, it will make debugging your code a lot easier. The log4j configuration is stored in the log4j2.xml file in the forgeSrc JAR. You can copy this file into src/main/resources and add this tag in the <Loggers> tag, between <Logger level="info" name="net.minecraft" additivity="false">...</Logger> and <Root level="all">...</Root> : <Logger level="all" name="net.minecraft" additivity="false"> <AppenderRef ref="FmlSysOut" level="INFO"/> <AppenderRef ref="ServerGuiConsole" level="INFO"/> <AppenderRef ref="FmlFile"/> </Logger> You can read more about configuring Log4j 2 here. This will override Forge's configuration completely. Ideally you'd exclude this file from your built mod, but I haven't worked out how to have Gradle do that yet. Now that I look at your latest.log, I can see there's a JsonSyntaxException being thrown from SoundHandler because your sounds.json was malformed.
  2. MCPBot tells me that EntityLivingBase#addRandomArmor ( func_82164_bB ) was renamed to EntityLivingBase#addRandomDrop on 2015-02-02 (in 1.. It still has this name in 1.8.9, but the method was removed in 1.9.
  3. The event is fired once per hand per side.
  4. It looks like SoundManager isn't writing to the FML log due to the log4j configuration, so the DEBUG level messages that are logged when sounds are played are discarded. Set a breakpoint in SoundManager#playSound and step through it when you play the sound. Does it play the sound or skip it?
  5. You actually need to copy the motion and pickup delay from the old Entity when you spawn the invulnerable one. You can see my implementation here.
  6. The default resource directory is src/main/resources. Have you configured this to be src/resources? Aside from that, your code looks correct. Was there anything in the FML log that wasn't in the console (i.e. anything logged below the INFO level)?
  7. RenderItem#renderQuads uses the quad's tint index to get the colour from ItemColors (i.e. the IItemColor registered for the Item ). If anaglyph mode is enabled, TextureUtil.anaglyphColor is used to translate the colour into an anaglyph colour. I don't know enough about the rendering system to say what happens when a colour is applied to a quad without a texture.
  8. There don't seem to be any errors in the log, I'm not too sure what's going wrong.
  9. The tint index is passed to IBlockColor / IItemColor so they know which part of the model is being coloured and can return the appropriate colour based on that. I believe the TextureAtlasSprite is a location on the block texture sheet to render on the quad (i.e. the quad's texture).
  10. Create a class that extends EntityItem and overrides isEntityInvulnerable to return true . This makes the item entity immune to all damage. In your Item class, override the following methods: Item#hasCustomEntity to return true Item#createEntity to create an instance of your EntityItem class with the specified location and ItemStack Item#getEntityLifespan to return Integer.MAX_VALUE This will spawn an invulnerable EntityItem with a lifespan of 2^31-1 ticks or approximately 3.4 years. If you want an item that actually never expires, you'll need to override EntityItem#onUpdate to do exactly the same thing as the existing method and its super method but not check the age/lifespan.
  11. Have you definitely got the built JAR in the server's mods folder? If you open the built JAR in an archive viewer (e.g. 7-Zip) or Java decompiler (e.g. Bytecode Viewer), are all of your compiled classes present? Does the FML log (logs/fml-server-latest.log) mention your mod? If you're not sure, upload it to Gist and link it here. In future, please use Gist or Pastebin to post logs/crash reports (if applicable) and code with syntax highlighting rather than posting screenshots. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
  12. Are there any errors in the log? Upload the full FML log (logs/fml-client-latest.log) to Gist and link it here.
  13. What you've posted should work in 1.8.
  14. The ItemCameraTransforms.TransformType enum describes the valid transform types for items. HEAD is used to render the item on entity heads, GROUND is used to render the item as an EntityItem and FIXED is used to render the item in item frames.
  15. Like I said, what diesieben07 is talking about doesn't exist in 1.8. It was added in 1.8.9. This is how I register the Render for my arrow entity in 1.8.9. This uses Java 8's method references, you'd use an anonymous class instead if you were targeting Java 6/7. This is how I register it in 1.8.
  16. The OP is still using 1.8 rather than 1.8.9, so IRenderFactory and the corresponding registration don't exist for them. I would suggest updating to 1.8.9 or 1.9 and using the method diesieben07 mentioned.
  17. The new stacktrace confirmed that it's caused by not being able to find the model file rather than being caused by something like a syntax error within it. However, I'm not too sure why it's not loading any of your assets. You could try exiting IDEA, deleting your project by running gradlew cleanIdea from the command line and then re-importing build.gradle into IDEA; though I can't guarantee that this will fix anything. You may not always be able to find tutorials for the latest version of Minecraft since they're just written by random members of the community. 1.9 is still quite new, so it may take a while for new tutorials to be made and old ones to be updated. A lot of core concepts have remained the same across many versions of Minecraft, so even older tutorials may still partially work. 1.8 introduced the model system for blocks and items, it's still mostly similar in 1.9. The registry system has been overhauled in recent 1.9 versions of Forge, but it looks like you're already using the new system. You can find Forge's official documentation here. This isn't a comprehensive guide to every part of Minecraft/Forge, but it does cover a few of the major concepts. Sometimes you just have to read through the Minecraft/Forge code to figure out how various parts of it work.
  18. What diesieben07 said is correct, but I suspect it may not be the cause of this particular error. Forge improved the error reporting for item model loading in 1.9-12.16.0.1837-1.9 (this commit), update to the latest version of Forge and post the new error.
  19. It sounds like you're using a static field instead of an instance field. We can't do much more than guess without seeing your code. If you want more help, upload the TileEntity class to Gist/Pastebin with syntax highlighting and link it here.
  20. ItemAxe can no longer be used with custom ToolMaterial s due to hardcoding the attack damage/speed for each ToolMaterial and using the ToolMaterial 's ordinal as an array index. See this issue for more details and an explanation of what the current plans to fix this are. In the meantime, extend ItemTool and use Item#setHarvestLevel to set the tool class to "axe" and the harvest level to the ToolMaterial 's harvest level. Some issues with your code that aren't directly related to axes: Use the new GameRegistry.register method instead of GameRegistry.registerItem / registerBlock . If you can't see it, update Forge. Don't use unlocalised names as registry names, the registry name methods were introduced in 1.8.9 to stop people doing that. If an Item should have the same registry and unlocalised names, set the registry name ( IForgeRegistryEntry#setRegistryName or one of the overloads from IForgeRegistryEntry.Impl ) and then set the unlocalised name to the full registry name ( IForgeRegistryEntry#getRegistryName ). This also applies to Block s. As an example, setRegistryName("foo"); setUnlocalizedName(getRegistryName().toString()) results in the registry name being modid:foo and the full unlocalised name being item.modid:foo.name . Most of my mod's Item s use this method to set their registry and unlocalised names, but some have completely separate registry and unlocalised names that they set manually (e.g. records). Don't use ItemModelMesher#register to register models, use ModelLoader.setCustomModelResourceLocation / setCustomMeshDefinition in preInit. Don't use unlocalised names for model registration. The default model for every Item is the one with its registry name.
  21. There's also a reference for the grammar of the Animation State Machine files used by the system here.
  22. Every sound name in your sounds.json file is automatically prefixed with your mod ID. The registry name and sound name of your SoundEvent should be the same ResourceLocation , which should include your mod ID. You can see my mod's SoundEvent registration here and the sounds.json file here.
  23. I can't help you much further, but I did find this Gist a while back that explains the grammar of the Animation State Machine files.

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.