-
Posts
19 -
Joined
-
Last visited
Everything posted by Jummit
-
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
-
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)
-
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.
-
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?
-
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...
-
Thanks a lot! That is exactly what I need.
-
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); }
-
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.
-
I need to find an item by its id for when I load recipes from json. How can I do that?
-
Yeah, I didn't notice it was nullable. Fixed.
-
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);
-
I want to pass the data to the ItemStackHelper to get the items it contains. ItemStackHelper.loadAllItems(container.getTileData(), items);
-
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?
-
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?
-
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?
-
That worked pretty good! Here is a terrible choppy video of it working.
-
Should I use tile entities for that? Or are normal block sufficient, for the non-core blocks at least?
-
Could I make a block that if placed creates a 3x3 block around itself, and if broken deconstructs it again?
-
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.