Skip 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'm not entirely sure about that part. I think the skin texture will be added to the texture atlas if you override IModel#getTextures to return it, you can then use the bakedTextureGetter argument in your override of IModel#bake to get the TextureAtlasSprite . You can probably create and store an instance of NetworkPlayerInfo in your IModel 's constructor, creating a GameProfile from the IModel 's UUID . Use NetworkPlayerInfo#getLocationSkin to get the ResourceLocation of the skin texture. If you call this early (e.g. in the constructor), the skin should be downloaded in the background and may be available by the time the texture atlas is created.
  2. When you extend a vanilla class, you need to override the vanilla NBT methods. When you create your own class that can be written to NBT, just implement INBTSerializable .
  3. Post the FML log.
  4. I'm not sure how to use a custom build of Forge in your mod, but cpw has a video explaining how to add your mod to a Forge development workspace in IntelliJ IDEA .
  5. Create the ItemStack of Items.SPAWN_EGG , then call ItemMonsterPlacer.applyEntityIdToItemStack to set the ItemStack 's spawned entity ID. Look at the implementation of this method to see how it produces the same NBT structure as you'd use in the command.
  6. Choonster replied to Lyras's topic in Modder Support
    I can't see any obvious problems with your code, I suggest stepping through it in a debugger to see where things go wrong. For the FOV values, look at AbstractClientPlayer#getFovModifier (where FOVUpdateEvent is fired) or the code from my mod that I linked in my first post.
  7. Biomes are stored in the Chunk#blockBiomeArray field. Use World#getChunkFromBlockCoords to get the Chunk at the specified position, then use Chunk#getBiomeArray to get the biome array. This array stores the ID of the Biome at each x/z position within the chunk, using (z & 15) << 4 | (x & 15) as the index. Use Biome#getIdForBiome to get the ID of a Biome .
  8. I recommend extending ItemTool and calling Item#setHarvestLevel in the constructor for each tool class. You can see my implementation of a multi-tool here.
  9. Choonster replied to Lyras's topic in Modder Support
    I explained how to handle the FOV in my first post. Post your new code.
  10. Post your FML log, blockstates file(s), model(s) and a screenshot of the directory structure containing these files.
  11. Random is a (pseudo-)random number generator. Call Random#nextInt to get a random integer in the specified range. Math.random returns a random number in the range [0, 1) (i.e. greater than or equal to 0, less than 1). If you multiply by 4 and add 1, the new range is [1, 5) ; which means that it will never be 0 and your potion effect will never be applied.
  12. You're registering each subtype as a variant of the item's registry name, so Minecraft will look for a blockstates file named with the item's registry name containing a variant for each of the subtypes. Is this what you want? What's actually happening? The FML log (logs/fml-client-latest.log) will contain any model loading errors, please post it.
  13. You have a _JAVA_OPTIONS environment variable setting the maximum memory to 512 MB, delete it. Where do I go to delete it? Environment variables are a feature of your OS, use your search engine of choice to find the answer.
  14. Choonster replied to Lyras's topic in Modder Support
    You're setting the pickup status to CREATIVE_ONLY when ammo is required (i.e. no Infinity enchantment or creative mode). This is the opposite of what you want. I suggest looking at ItemBow#onPlayerStoppedUsing again.
  15. Choonster replied to Lyras's topic in Modder Support
    In EntityArrow#onCollideWithPlayer , the item is only added to the player's inventory if the pickup status is ALLOWED .
  16. The Biome Dictionary is a part of Forge. BOP registers all of its biomes with the Biome Dictionary, using the appropriate types for each one. In 1.7.10, this is done here.
  17. You can use BiomeDictionary.getBiomesForType to get all BiomeGenBase instances registered as the specified BiomeDictionary.Type (e.g. FOREST or PLAINS ). 1.7.10 is extremely outdated and no longer supported, update to 1.10.2.
  18. Models can be generated on demand and cached. I suggest looking at ModelDynBucket , it uses an ItemOverridesList to generate a model with the texture of the Fluid contained in the bucket.
  19. The attribute modifiers and backstabbing code should run on both sides.
  20. This is probably possible with a custom model, though the asynchronous nature of skin downloading may make things tricky. You'll need an ICustomModelLoader , IModel and ItemOverridesList for your model. I don't know of any tutorials on these, but there are several examples in Forge itself. diesieben07 talks about a custom model in this thread, though it was for 1.8.9 so things are slightly different now.
  21. Yes. Higher attack damage = more damage dealt, higher attack speed = less cooldown after each attack.
  22. I explain this here. Use the same method I described in the post linked above to change the ATTACK_DAMAGE attribute modifier. You'll probably want to override ItemSword#getDamageVsEntity as well, though this is only used by non-player entities to determine whether they should replace their currently held sword with one on the ground (the one with a higher return value from this method is favoured). The actual damage dealt when attacking is controlled by the attribute system. Override Item#hasContainerItem(ItemStack) to return true and override Item#getContainerItem(ItemStack) to return its argument (after making any necessary modifications, e.g. damaging the item). AttackEntityEvent is fired whenever a player tries to attack to an entity, before it checks whether the entity can actually be attacked and damaged. I'd recommend overriding Item#hitEntity and performing these checks there instead. You'll probably need to use the Entity#rotationYaw field of the target to get its facing and compare the positions of the entities. I don't know exactly how to achieve this.
  23. To be more specific, use a log4j2 Logger . You can get one with your mod's name from FMLPreInitializationEvent#getModLog or with any name you want from LogManager.getLogger .
  24. Java is picking up the -Xmx256M argument from somewhere, limiting the memory to 256 MB. Do you have the _JAVA_OPTIONS environment variable set? If so, delete it.
  25. Don't create your own instance of BlockColors , it's a singleton. Minecraft will only use its own instance, stored in the Minecraft#blockColors field.

Important Information

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

Account

Navigation

Search

Search

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.