-
Posts
106 -
Joined
-
Last visited
Posts posted by KidKoderMod033109
-
-
Hi,
I'm working on a battery to store power in my mod and would like to the power to be displayed in a tooltip. I'm using this code to change the tooltip:
@OnlyIn(Dist.CLIENT) @Override public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) { super.addInformation(stack, worldIn, tooltip, flagIn); tooltip.add(new StringTextComponent("Power" + power)); }
How can I make it so that the tooltip is different for every item in the inventory?
Eg. in slot 1 the battery has 10 power and in slot 2 the battery has 5 power. Then when a battery is destroyed all power is lot
Thank in advance
-
-
Hi,
I'm working on a mod in IntelliJ IDEA, and I've seen people on Eclipse edit their code and update their game, but they didn't restart the modded instance. I'm wondering how I can do this myself?
Thanks in advance
-
Ahh. That would explain it
-
The code is here https://github.com/KidKoder09923/SimplyCopper
-
Hi,
I was working on making a TE. But, when I place it down, the game crashes.
Here is the crash log:
https://gist.github.com/KidKoder09923/2d0ac3ddfd76360d2b825a315615fe4c
EDIT: Here is line 23-25:
public TileEntity createTileEntity(BlockState state, IBlockReader world) { final TileEntity tileEntity = ModTileEntityTypes.COPPER_CORE.get().create(); return tileEntity; }
Thank in advance
-
Hi,
I working on making my Tile Entity store data, but when I tried to override the read function, there was no such thing. Here is my code:
public class CopperCoreTileEntity extends TileEntity implements ITickableTileEntity { public int x, y, z; private int power = 0; private int tick; private boolean inited; public CopperCoreTileEntity(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); } public CopperCoreTileEntity() { this(ModTileEntityTypes.COPPER_CORE.get()); } public void tick() { if(!inited) init(); tick++; if(tick==6000 && power > 0) { power--; } } private void init() { inited = true; x = this.pos.getX() - 1; y = this.pos.getY() - 1; z = this.pos.getZ() - 1; tick = 0; } @Override public CompoundNBT write(CompoundNBT compound) { compound.put("initvalue", NBTHelper.toNBT(this)); return super.write(compound); } }
How do I override the read function?
Thanks in advance,
Kid Koder
-
Got it!
this(ModTileEntityTypes.COPPER_CORE.get());
Works like a charm(I think. No error are preview in IntelliJ)
-
Also,
3 minutes ago, Draco18s said:No, you're registering a TileEntity with that line. You also, additionally need a TileEntityType.
So how to I register that?
-
super(new TileEntityType<CopperCoreTileEntity>);
Does that work?
-
-
But I'm currently registring that Type.
-
But then what do I pass in to the super() method?
-
-
Just now, Draco18s said:7 minutes ago, KidKoderMod033109 said:
CopperCoreTileEntity::new
^ No parameters specified
Oh, I see. How do I pass the parameters. And what do I pass. Do I do TileEntityType<CopperCoreTileEntity>?
-
Hi,
So, I'm trying to register a Tile Entity to the game, and I'm using this code:
TILE_ENTITY_TYPES
public static final DeferredRegister<TileEntityType<?>> TILE_ENTITY_TYPES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, "simplycopper"); public static final RegistryObject<TileEntityType<CopperCoreTileEntity>> COPPER_CORE = TILE_ENTITY_TYPES.register("copper_core", () -> TileEntityType.Builder.create(CopperCoreTileEntity::new, BlockInit.COPPER_CORE).build(null)));
And I get the error:
Cannot resolve method 'create(<method reference>, net.minecraft.block.Block)'
I have no clue how to fix this.
Here is my CopperCoreTileEntityClass:
Quotepublic class CopperCoreTileEntity extends TileEntity { public CopperCoreTileEntity(TileEntityType<?> tileEntityTypeIn) { super(tileEntityTypeIn); } }
Thanks in advance,
Kid Koder
-
@Draco18s How does that work?
-
Fixed it. Just backport to 1.16.1
-
Hi,
I'm trying to add copper ore and I wanted to have it generate in the Overworld. I'm using the latest version of Forge MDK. I am trying to use this function:
private static void genOre(Biome biome, int count, int bottomOffset, int topOffset, int max, OreFeatureConfig.FillerBlockType filler, BlockState defaultBlockstate, int size) { CountRangeConfig range = new CountRangeConfig(count, bottomOffset, topOffset, max); OreFeatureConfig feature = new OreFeatureConfig(filler, defaultBlockstate, size); ConfiguredPlacement config = Placement.COUNT_RANGE.configure(range); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(feature).withPlacement(config)); }
too add it, but the class CountRangeConfig doesn't exist. In addition to that the COUNT_RANGE variable doesn't exist and the function addFeature doesn't exist.
I have no clue what is going on.
Is there any way to fix this in IntelliJ IDEA
Thanks,
Kid Koder -
Still doesn't work. Oh well, thanks for your time.
-
Loading wrong project
-
Tried that, still doesn't work
-
-
3 minutes ago, Beethoven92 said:
Inside the window that shows up you can select which of your current workspace projects you want to run
Are there any windows, as I opened Run Configurations, but can't figure out what to do next
[1.16] Translucent blocks aren't translucent, even after setting them with RenderTypeLook
in Modder Support
Posted
Hi!
I've used `RenderTypeLookup` to set my block to translucent, but I still appears to be rendered as a full block. I've tried using the 3 translucent type and 2 cutout types.
Here is my code:
And my model:
Translucent Moving Block and Translucent No Crumbling don't render the block, so I'm sure that the code works, just it's not making the block transparent. Anyway to fix this?