Everything posted by poopoodice
-
[1.16.5]Attaching an inventory to an item
Return your capability provider there
-
[1.16.5]Attaching an inventory to an item
It's a supplier that supplies an instance, so of(() -> new MyProvider(); or just of(MyProvider::new)
-
Executing code every tick and saving global data
Just a thought, instead having your own timer, you can have an "extra time" where when the night skips you add it by xx value...or something similar, and when you need that specific value you just get it by adding it with the current game time.
-
[1.16.5] How to render texture like a nameplate?
Just change your code to the code I attached, I've tested it that it worked. Play around with it and should be easier for you to understand.
-
[1.16.5] How to render texture like a nameplate?
This isn't quite right. int color = (int) (Minecraft.getInstance().gameSettings.getTextBackgroundOpacity(0.25F) * 255.0F) << 24; float alpha = (float)(color >> 24 & 255) / 255.0F; float red = (float)(color >> 16 & 255) / 255.0F; float green = (float)(color >> 8 & 255) / 255.0F; float blue = (float)(color & 255) / 255.0F; check EntityRenderer L97, 98, and FontRenderer#func_238441_a_ (finish)
-
Get all Furnace Fuels
ForgeRegistries.ITEMS.getValues() allows you to get all items. If I were you I will create and save the recipes with vanilla fuels, and then maybe check the input dynamically if it's from other mods (iterate through all other mod items once, and cache them), although there should be a better way for doing this... In fact you might not need recipes for this, unless you really want the players to be able to customize them.
-
Displaying information help
I'm not quite sure what is the usage but you can either new one or use IReorderingProcessor.EMPTY, and since ITextComponent inherits ITextProperties, some checkings and casting should work.
-
Displaying information help
No, use @Mod.EventBusSubscriber(Dist.CLIENT) to register or just make sure the class is not referenced by any common or server stuff.
-
Displaying information help
You shouldn't be rendering stuff there, use RenderTooltipEvent.
-
Get all Furnace Fuels
Comment of the method: so you should probably use it. Can you show more of your code?
-
Displaying information help
Why do you need it?
-
[1.16.5] How to render texture like a nameplate?
You should also try enable alpha test and blend.
-
[1.16.5] How to render texture like a nameplate?
Disable depth test so it renders through walls and other stuff (no checking for which comes first, and which goes after).
-
Custom Advancement Help
Is it named .json?
-
Saving entity fields and NBT
You have to call honeyType.getRegistryName().toString() to receive something like "mymod:honey_block", otherwise you will get "honey_block" that Minecraft will automatically put the prefix "minecraft:" in front of it, which does not exist.
-
Execute command from within mod
ICommandSource.DUMMY The second parameter is a string where is the command inserted, e.g. "/gamemode survival". And then it will just print an error message if the command cannot be executed.
-
Metal-Only Ingot Tag
Might be wrong, but I think in here you should be comparing items instead of itemstacks. And in fact this returns an array that contains all of the "without" items, which I think it's the opposite of your target? Because you then @Override public boolean test(@Nullable ItemStack p_test_1_) { if (super.test(p_test_1_)) { for (ItemStack itemStack : this.of.getItems()) { if (!this.without.test(itemStack)) return true; } } return false; } check if the stack is not in "without", where does not make much sense.
-
[1.16.5] Help figuring out how to register entities
https://mcforge.readthedocs.io/en/latest/concepts/registries/
-
Saving entity fields and NBT
You can call IForgeRegistryEntry.getRegistryName.toString() and save it to the nbt, to read it you can use ForgeRegistries.BLOCKS.getValue(new ResourceLocation(nbt.getString("saved_block"))) something like that.
-
Displaying information help
Screen#renderToolTip will render the item information, e.g. on the hovered slot.
-
Getting the IFactory of an entity for registry
Just look at how vanilla register it in EntityType.java, there's only 2 method named create in EntityType.Builder
-
Getting the IFactory of an entity for registry
Use EntityType.create(), the one that is WITHOUT IFactory as the first parameter.
-
[1.16.5] Add metals that Piglins won't attack
IIrc there's item tags for them, check out ItemTags.
-
Getting the IFactory of an entity for registry
Vanilla uses the builder that returned null for the factory because players shouldn't be spawned in usual ways.
-
Getting the IFactory of an entity for registry
Check out Java lambda. IFactory is an interface that has an abstract method create(EntityType, World) that you need to implement it your self. class MyEntityFactory implements IFactory<MyEntity> { @Override MyEntity create(EntityType<MyEntity> type, World world) { return new MyEntity(type, world); } } register(new MyEntityFactory(), ....) -> register(new IFactory<MyEntity>() { @Override MyEntity create(EntityType<MyEntity> type, World world) { return new MyEntity(type, world); } }, ....) -> register((type, world) -> new MyEntity(type, world), ....) -> register(MyEntity::new, ....) However vanilla is passing in null as Players are kinda different to other entities (they don't spawn naturally, no spawn eggs..etc). They are created and added with a totally different way.
IPS spam blocked by CleanTalk.