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.

Leaderboard

Popular Content

Showing content with the highest reputation on 07/05/17 in all areas

  1. if (!player.getHeldItemMainhand().isEmpty() && player.getHeldItemMainhand().getItem() == Items.FLINT_AND_STEEL) Something like that.
  2. I think you ment BlockPos, not BlockState. OP, how do you know that this does not work? Did you place a breakpoint after those 2 if statements and it is not being triggered? Because there are more thing that would stop your structure from spawning later down the line. Those 2 checks apart from creating a new BlockPos object every time(don't do that btw) look fine. As @Choonster said, do not use getBiomeForCoordsBody. Why are you comparing classes here? If your intention is making the structure only spawn in the plains biome you can either use BiomeDictionary or directly compare the biome to Biomes.PLAINS. This will be true if the block above the inital ground height is not air thus forbiding your structure from spawning. Tallgrass, for example... You do not need this. You can return from a loop directly when your air check fails. With your current code you are just wasting time in the loop if the structure won't generate. Never use IDs. They can and will change. Blocks class exists for a reason. getStateFromMeta should not be called. Use BlockStates. A state with meta 0 will most likely be the default state. This way of spawning structures is very confusing and painful to update/fix later. Use templates if they are available in whatever version you are modding for. Do not create a new Random object every time you need to do something. You have an instance of Random passed as an argument. nextInt returns a value from 0 to the number specified excluding this number. nextInt(15) will return a number from a range of [0-14]. => world.getHeight(i, k) random.nextInt(10) == 0 is much more understandable and does pretty much the same.
  3. Item::getItemFromBlock as the name implies gets you an Item from a Block. Unless ModItems.JadeDragonScales is a Block(and if it is why is it located in the ModItems class?) you are not doing things correctly. Just pass your ModItems.JadeDragonScales to the ItemStack constructor directly, it will figure everything out for you.
  4. This should be possible if you give the coloured faces of the model a separate tint index (see the wiki for an explanation of the format) and register an IItemColor for the Item. Use the tintIndex argument of IItemColor#getColorFromItemstack to determine which colour to return. If you're using builtin/generated or a model that extends it (e.g. item/generated), each layerN texture has a tint index of N.
  5. Scala is likely to be removed at some point in the future, so Forge probably won't be including newer versions of it.
  6. Minecraft calls BlockModelShapes#registerBuiltInBlocks for the shulker box Blocks, which means that BlockStateMapper#getBlockstateLocations and BlockStateMapper#getVariants return an empty Set/Map respectively when called with one of the Blocks. You can achieve the same result by implementing IStateMapper#putStateModelLocations to return an empty Map (using Collections.emptyMap) and registering an instance in ModelRegistryEvent using ModelLoader.setCustomStateMapper.

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.