-
Posts
19 -
Joined
-
Last visited
Posts posted by Jummit
-
-
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.
Quotenewmtl None
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
map_Kd What to put here?The forge wiki states
QuoteThe
.mtl
file will probably have to be manually edited to change the paths pointing to textures into MinecraftResourceLocation
s.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.
-
1 hour ago, Cadiboo said:
This approach involves baking the model and registering neccesary textures
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!
-
Should I use tile entities for that? Or are normal block sufficient, for the non-core blocks at least?
-
2 minutes ago, Draco18s said:
Then you need way more.
There is no way around this, you MUST place a block in each of the 27 occupied places otherwise all kinds of things get screwed up, like players falling on it or mobs trying to pathfind over it.
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.
Custom Stats 1.14.3
in Modder Support
Posted · Edited by Jummit
For anyone searching for this, I managed to get it working in 1.15.2 with this code:
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