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.

MattNL

Members
  • Joined

  • Last visited

Everything posted by MattNL

  1. Okay, so in my block registry? If so, how? I tried looking at vanilla's code, but my registry resembles other small flowers' registries... so either I'm missing something, or I'm just stupid.
  2. Just an interesting bug I noticed in 31.0.16 where note blocks seem to increment twice when clicked. I'm also not sure if others have this issue, but I just wanted to bring this issue to the spotlight.
  3. So, I'm having an... interesting bug, and, after about an hour, I'm not sure what's causing it. My rose texture is normal and transparent when held or in an item frame, but when placed, the transparency becomes black. I'm not sure if this is simply a bug with Forge, or if something significant changed from 1.15.1 to 1.15.2. I'm modding with version 31.0.16. Blockstate: { "variants": { "": { "model": "[NAMESPACE HERE]:block/rose" } } } Block Model: { "parent": "block/cross", "textures": { "cross": "[NAMESPACE HERE]:block/rose" } } Item Model: { "parent": "item/generated", "textures": { "layer0": "[NAMESPACE HERE]:block/rose" } } Item Registration (Not sure if this has anything to do with it because it's actually just a FlowerBlock): new BlockItem(ModBlocks.rose, new Item.Properties().maxStackSize(64).group(ItemGroup.DECORATIONS)).setRegistryName("[NAMESPACE HERE]", "rose"), Thanks in advance! ?
  4. Thank you very much! Sometimes I stumble across the right thing and I'm just not sure about it. Also, thanks for the heads up about the key bind event. ?
  5. I'm more of a C++ programmer, I'm only into Java for Minecraft modding... so I guess not? I'm not too used to the heavy object oriented programming of Java, so I'm really just looking for some clearance and assistance, with all do respect. I was just wondering if there was a way I could possibly create a new BlockPos variable, or something else along those lines. If not, then, go on with your day.
  6. I need to get a block from below a block, but I haven't really found a way to do this. Is there some way to "create" a new BlockPos? Is there a better way for me to get a block under an existing block? int x = pos.getX(); int y = pos.getY() - 1; int z = pos.getZ(); // Some way to get a block at a new position? // Perhaps something like this: BlockPos example = new BlockPos(x, y, z)? // // Is that even possible? if(Minecraft.getInstance().gameSettings.keyBindSprint.isKeyDown()) { worldIn.setBlockState(pos, Blocks.NOTE_BLOCK.getDefaultState().with(NOTE, _new)); } else { worldIn.setBlockState(pos, ModBlocks.noteblock_low.getDefaultState().with(NOTE, _new)); }
  7. Well, honestly, it's fine because I decided against including the feature. Thank you for your help though, have a great day!
  8. Oh, I see... well that's useful to know! I'm going to try implementing your JSON-style replacement. Thank you very much!
  9. So, I realized I didn't really mention what the problem was, oops. I need to get the contents of broken containers, not just chests, and write that data to an item stack (presumably through net.minecraft.client.Minecraft.storeTEInStack).
  10. One of the features in my mod (for version 1.14.4) allows for containers to drop with NBT data stored when broken with a Silk Touch enchanted tool. The problem being is that I have no idea if I'm wasting my time or not. This is what I have so far: @SubscribeEvent public void onBlockBreak(BlockEvent.HarvestDropsEvent event) { if(event.getHarvester().getType() == EntityType.PLAYER) { Block blockIn = event.getState().getBlock(); TileEntity teIn = Minecraft.getInstance().world.getTileEntity(event.getPos()); if(event.isSilkTouching()) { for(ItemStack stack : event.getDrops()) { if(stack.getItem() == Items.CHEST) { stack = Minecraft.getInstance().storeTEInStack(stack, teIn); } } } } } Also, just to be clear, this does not have a class of it's own, it's in the main Mod Class. Thanks in advance!

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.