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.

Jummit

Members
  • Joined

  • Last visited

Everything posted by Jummit

  1. For anyone searching for this, I managed to get it working in 1.15.2 with this code: public static final ResourceLocation INTERACT_WITH_SHIP_CONTROLLER = registerCustomStat("interact_with_ship_controller"); private static ResourceLocation registerCustomStat(String name) { ResourceLocation resourcelocation = new ResourceLocation(MOD_ID, name); Registry.register(Registry.CUSTOM_STAT, name, resourcelocation); Stats.CUSTOM.get(resourcelocation, IStatFormatter.DEFAULT); return resourcelocation; } You can then increase the stat: player.addStat(Registry.INTERACT_WITH_SHIP_CONTROLLER); Don't forget to localize it so it has a name in the stat list: "stat.sol.interact_with_ship_controller": "Interactions with Ship Controller" For fun, you can track your new stat with these commands: /scoreboard objectives add stat minecraft.custom:minecraft.interact_with_ship_controller /scoreboard objectives setdisplay sidebar stat
  2. You can do this: public class ModBlocks { @GameRegistry.ObjectHolder("modtut:firstblock") public static FirstBlock firstBlock; } (taken from https://wiki.mcjty.eu/modding/index.php?title=Basic_Block-1.12)
  3. I want to render planets in a space dimension, but don't know where to put the code to do that. Is RenderTickEvent what I want? I found this pretty helpful, but I don't want it to depend on blocks: http://greyminecraftcoder.blogspot.com/2014/12/the-tessellator-and-worldrenderer-18.html This is what I have so far: @Mod.EventBusSubscriber public class EventHandler { @SubscribeEvent public static void renderTick(RenderTickEvent event) { if (Minecraft.getMinecraft().currentScreen != null) { return; } if (event.phase==Phase.START) { // render sphere .obj } } EDIT: Turns out RenderTickEvent isn't the right event. Using RenderWorldLastEvent worked.
  4. I want to make a spaceship that can teleport from earth to a space dimensions with all blocks and entities it's made of. What is the best way of doing that?
  5. I got something to work, I now have an entity that renders an obj model. How can I make it textured? I tried setting the map in the .mtl file, but it always gives me the error texture. The forge wiki states But when I put in "minecraft:stone" or "mymod:mytexture" it doesn't work either. Never mind, I just read the "Resources" page of the forg e wiki and figured it out: "minecraft:stone" should be "minecraft:blocks/stone". I still can't get my own textures to work...
  6. Thanks a lot! That is exactly what I need.
  7. And that's where I'm struggling... OBJLoader.INSTANCE.addDomain(MOD_ID); OBJLoader.INSTANCE.onResourceManagerReload(Minecraft.getMinecraft().getResourceManager()); IModel model = OBJLoader.INSTANCE.loadModel(new ResourceLocation(MOD_ID, "models/cube.obj")); //model.bake(state, format, bakedTextureGetter) ? @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { // what to put in here? } Or is this the better way? @Override public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks) { TileEntityRendererDispatcher.instance.render(MY_TILE_ENTITY, x, y, z, 0); }
  8. I only found tutorials about rendering obj models as items, armor or blocks. How can I make an entity use an obj? I have a net.minecraft.client.renderer.entity.Render ready to go.
  9. I need to find an item by its id for when I load recipes from json. How can I do that?
  10. Yeah, I didn't notice it was nullable. Fixed.
  11. What do I have to give the getCapability function? This doesn't work: container.getCapability(IItemHandler.class, EnumFacing.EAST); EDIT: Got it. container.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.EAST);
  12. I want to pass the data to the ItemStackHelper to get the items it contains. ItemStackHelper.loadAllItems(container.getTileData(), items);
  13. I have this problem that when I get the tile data of a chest it is empty. I use world.getTileEntity(pos).getTileData(), and that works on one of my custom ones, which looks like this: "{built:1b,multiblock:"test.json",multiblockcenter:[I;-906,5,310]}", but if I print the chest data it is empty ("{}"). Why is that?
  14. Thanks for the answer! My only question left is: Why do so many mods still use this method if it means tons of copied code and many inconveniences?
  15. I recently looked at the common issues and recommendations and saw why base classes are bad. I can't seem to find any mod that has no ItemBase and BlockBase classes. How would I do it differently?
  16. That worked pretty good! Here is a terrible choppy video of it working.
  17. Should I use tile entities for that? Or are normal block sufficient, for the non-core blocks at least?
  18. Could I make a block that if placed creates a 3x3 block around itself, and if broken deconstructs it again?
  19. How would I go about making a 3x3 block that you can place and break like a normal one? I looked into tile entities and got one to work, but how can I make it occupy nine blocks? I also looked at how the bed does it, and it looks like what I need, but that are only two parts. Mine has way more.

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.