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.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. The problem is you are using the event wrong. RenderGameOverlayEvent is a parent event, with a *-load of children. You need to specify at which step of the event you do the rendering (Pre, or Post ?), and which child event (ElementType) to use. Without that, you are doing the rendering multiple times in the same rendering cycle. Which basically mean you are rendering your own gui on top of itself.
  2. Did you register the spear entity ? EntityRegistry.registerModEntity(EntitySpear.class, ...);
  3. It does happen. Of course, we are talking about breaking time of a block, which no player can actually measure precisely. But consider this issue is more general than the block hardness only, all Block data (except stored in a TileEntity) is subject to this effect, thus your idea is really flawed. Don't be worried though, Forge provides hooks to effectively achieve what you want. (BreakSpeedEvent, in this case) I think the original topic is done anyway. Answers have been given, and the OP issue with xray should be discussed elsewhere too.
  4. Override methods in Item which have ItemStack as argument. Add different behaviour according to that ItemStack NBTTagCompound. Example: @Override public int getMaxDamage(ItemStack stack) { if(stack.hasTagCompound() && stack.stackTagCompound.hasKey("SubType")){ return new ItemBehavior(stack.getKey("SubType")).getMaxDamage(); } else return super.getMaxDamage(stack); }
  5. Note that while getContainerItemStack(ItemStack) is easier to use, it will do the same thing for every recipe containing your item.
  6. Make a ICraftingHandler. In onCrafting(args) check the crafting space (IInventory) for your items, and the ItemStack for your diamond dust. Then use something like if (!player.inventory.addItemStackToInventory(stack))//try to put into the player inventory, if full... player.dropPlayerItem(stack);//drop the item to give the player (EntityPlayer) another item.
  7. BiomeManager#addVillageBiome(BiomeGenBase) typically does that for you. I really recommend the use of events. There are really simple event tutorials on the wiki, like the Bonemeal, or the SoundLoad one, which can get you started.
  8. You can use the BiomeEvent.GetVillageBlockID event to change block according to the biome the village structure is generated in. The default village generator (MapGenVillage) is used in ChunkProviderGenerate. You can use this chunk provider as a base for your own, or use the InitMapGenEvent.
  9. Fixed that for you @polkzminer I'd recommend you the useful "for(variables_init, conditions, loop_increment)" keyword.
  10. That would only work with one player. And I doubt you have one alone player on your server. I'd suggest you study them thoroughly, checking code and such. There may be more simple and obvious ways than making a mod with incompatibilities and such.
  11. You couldn't simply give a new block the stone texture in your code ? Wouldn't that be enough against xray ?
  12. Maybe I am blind, but I don't see any code.
  13. You need a KeyHandler class for that. You can send a chat message to the player with EntityPlayer#sendChatMessage(ChatMessageComponent)
  14. ...The ItemTool constructor expects it.
  15. I don't see how you can do it without actually saving the entire world a second time, at worst. Why do you want to know ? Maybe you don't need to do any of this at all.
  16. Use EnumHelper#addToolMaterial(...) This will return you the material to use for your items.
  17. Use a newer version of Forge, it will be in the event package.
  18. Seems you can't use the melon stem renderer without extending BlockStem. You can do that, or set your own block renderer, there is a generic tutorial for that on the wiki.
  19. protected boolean isAIEnabled() { return false; } Did you change this in your entity, or does any of your parent classes override this ? Or this ? public float getAIMoveSpeed() { return this.isAIEnabled() ? this.landMovementFactor : 0.1F; }
  20. Well you can extend BlockCrops and use the melon stalk renderer with getRenderType(){return wtv-id-melon-type-is}.
  21. How did you define this ? attackingSpeedBoostModifier Maybe your boost is not applied or too much for Minecraft limits. Also, what parameters did you use when registering your mob ?
  22. applyEntityAttributes() This is where the base attributes are set.
  23. There is an event for that. ItemDestroyedByPlayerEvent or something.
  24. Are you doing anything to the player ? It looks like it tried to expand its bounding box forever...
  25. Obviously, you are not a NetworkMod. Add @NetworkMod.

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.