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. For a command, you can use CommandBase.func_175757_a to parse a BlockPos from x, y and z coordinate arguments. The int argument is the starting index of the command's coordinate arguments and the boolean argument is whether to use the centre coordinate of the block (i.e. add 0.5) if the user specified an absolute integer coordinate. I'm not really sure why the last argument is necessary.
  2. No need to use events if it's your own Block . Override Block#getPlayerRelativeBlockHardness to return -1.0f to prevent a player from starting to mine the Block and override Block#removedByPlayer to return false to prevent a player from breaking the Block (probably not strictly needed for vanilla, but mods with AoE mining tools like Tinkers Construct may break a Block without checking its hardness).
  3. That code is designed to apply modifiers from an equipment ItemStack (held item or equipped armour). If you're applying a modifier from some other mechanic, that's not the way to do it. Saved modifiers only save when the Entity is written to NBT (generally when saving the world). When a player respawns, a new EntityPlayer is created (without copying the attribute NBT) and PlayerEvent.Clone is fired; you should be able to use this event to reapply the modifiers.
  4. Just like in 1.7.10, there's an overload of setBlockState with and without the flags argument.
  5. Extend BlockBush (or the appropriate subclass) and override getCollisionBoundingBox to return the same thing as the implementation in Block .
  6. You still have a syntax error in your model. Did you remove the semicolon?
  7. As the log says, you have a syntax error in your redstonesword model (an unclosed string with a semicolon after it). JSONLint will tell you what the problem is in more detail.
  8. Rendering of the fishing line and bobber is done in RenderFish .
  9. You'll probably need to make your own recipe class that implements IRecipe (extending an existing implementation will simplify things) and override IRecipe#getRemainingItems to return an array containing the container item for each slot (if any) and your custom remaining item for any slot containing the appropriate vanilla item. ForgeHooks.defaultRecipeGetRemainingItems will create and fill an array of the container items, so you can just search for the vanilla item. If you extend an existing shaped/shapeless recipe class, you can probably just call super.getRemainingItems instead of the ForgeHooks method. Make sure you register your recipe class with RecipeSorter.register .
  10. If it's your own item that should give something back, you need to use the container item system. I've written an example of an unbreaking container item (never breaks) and a breaking container item (breaks after a fixed number of uses). You can see how to use them in recipes here. These examples are for 1.7.10, but should work in 1.8 as well.
  11. I don't think Minecraft imposes a maximum length. The file will be compressed when its in the mod's JAR, I don't think you can compress it in any other way. I'm not sure why there'd be a pause. Do you get a pause when playing the OGG in a normal audio player?
  12. They're usually similar, but not always the same. The wiki does have a list of all vanilla block and item names here, though.
  13. You don't. Just pass the mod ID and item name as separate arguments.
  14. Why not use the item's GameRegistry name and GameRegistry.findItem ?
  15. I copied your sounds.json into my own, put an audio file at assets/testmod2/sounds/audio/test.ogg and created a new record class using "record.rawk" as the sound event and it worked without issue. You can see what I did here.
  16. 90% of the code in SummontheRawk is pointless, there's no need to override a super method to do exactly the same thing. All you need to override is getRecordResource . When you do override a method, you should add the @Override annotation to it. You can print text to the log/console using the standard System.out (for quick and dirty debugging) or FMLLog (for properly formatted output). You can also use a wrapper around FMLLog , like this. You can also set breakpoints and launch Minecraft in debug mode. Do you get any warnings from SoundManager earlier in the log?
  17. The file paths in sounds.json are relative to assets/<modid>/sounds, so your path is invalid unless your sound file is located at assets/themoneymod/sounds/audio/test.ogg. There should be a warning from SoundHandler earlier in the log saying that the file doesn't exist and can't be added to the sound event.
  18. If you've set up a ForgeGradle workspace, you'll have a copy of Minecraft's assets in ~/.gradle/caches/minecraft/assets (replace ~ with %USERPROFILE% on Windows).
  19. The ResourceLocation returned from ItemRecord#getRecordResource is used as the name of a sound event, not a file. You need to create a sounds.json file in assets/themoneymod in this format. Your sound files need to go in assets/themoneymod/sounds. If you name the sound event records.<recordname> (where <recordname> is the argument you passed to the ItemRecord constructor), you can just use the name argument of getRecordResource directly. I have an example implementation of a record here and a sounds.json file here.
  20. Override the method and add a String to the List for each tooltip line. You should add the lines to your lang files and use StatCollector.translateToLocal to translate them to the client's language.
  21. Create your own class that extends ItemBlock and overrides Item#addInformation . This method has an ItemStack argument, which has a metadata value. Register your Block using GameRegistry#registerBlock(Block, Class<? extends ItemBlock>, String) instead of GameRegistry#registerBlock(Block, String) .
  22. It looks like you've used the U+201C LEFT DOUBLE QUOTATION MARK (a.k.a smart quote) character instead of the U+0022 QUOTATION MARK character.
  23. You can use InventoryPlayer#addItemStackToInventory to add an item to a player's inventory (stored in the EntityPlayer#inventory field). Where you call this from depends on when you want the item to be given to the player.
  24. EntityPlayer#getItemInUse is marked as @SideOnly(Side.CLIENT) , which means that it doesn't exist on the server. To access the EntityPlayer#itemInUse field on the server, you'll need to use reflection or an access transformer.

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.