Everything posted by squidlex
-
Minecraft won't initialize
I'm sorry I couldn't really be of any help
-
Minecraft won't initialize
I'm an idiot and forgot it was included, thanks for pointing that out
-
Modifier public not allowed here
It's worth familiarising yourself with Java accessors. Research Getters and Setters, some people dislike them but they're quick and easy for accessing a private variable and Minecraft's code is full of them.
-
Modifier public not allowed here
You're trying to make it public from inside a private event
-
My mod doesnt show the name of my item
No problem, happy coding
-
My mod doesnt show the name of my item
Is your lang meant to be called in_us.json or was that a typo? Try en_us.json
-
[1.15.2] How to add a shortened hyperlink to the chat
Thanks for your help! I now have myMessage.getStyle().setClickEvent() But I don't know how to actually provide a link.
-
1.15.2 How to make a class for several blocks
What do you mean by making a class file? Out of interest, are you using DeferredRegisters for this?
-
Minecraft won't initialize
Have you downloaded Java 8 specifically? If so was it 64x or 32x? Also do you have any gamepads connected? If so try disconnecting them. Apologies for so many questions haha All I can find online in terms of suggestions is to restart your computer, hope at least something I've said helps!
-
Error when loading up minecraft 1.15.2 with forge
Removing custom skin manager should (hopefully) fix it, I'd try this first. The mod is trying to access a class that does not exist in your minecraft directory. If nothing happens, uninstall OfflineSkins too, although I can't see how that is effecting it in your crashlog. If that doesn't work, or even if it does, try updating and reinstalling Forge.
-
Had this issue but Im not sure what it is?
No problem, if you need anymore help after this thread is locked PM me.
-
Had this issue but Im not sure what it is?
Make a backup of it first, then navigate to saves/yoursavename/stats Although from looking at your logs further this is a crash from initialising the game, so find what mod adds in the stats the config specifies could be the issue. entity.robot.name
-
Had this issue but Im not sure what it is?
You have a duplicate stat id, I read somewhere that this can be fixed by deleting your stats folder although I'm not sure. Else it could be an issue with whatever mod you have that adds this: 'entity.robot.name' Just a heads up, a moderator will lock this post soon as 1.12 is no longer supported on this forum (for very just reasons).
-
[1.15.2] How to add a shortened hyperlink to the chat
I'm looking to send this message if a mod is not installed to the chat: 'To use all the features of this item, please install the latest version of 'The Midnight', which can be found here' I've already got everything in place for checking if the mod is installed, but I don't know where to go from here, a code example would be incredibly helpful to me! What I've already got: if(ModList.get().isLoaded("midnight")) { if (worldIn.isRemote) { playerIn.sendMessage(/*a hyperlinked message*/); } } Thank you for your time and help!
-
[1.15.2] Only register an item when another mod is loaded
Excellent, thanks for all your help!
-
[1.15.2] Only register an item when another mod is loaded
I see, thank you for your help Is there an easy way to remove them from the creative menu if the mod is not present?
-
[1.15.2] Only register an item when another mod is loaded
I'm looking to add support for other mods, and I want to only register an item if said mod is present. For example only load a custom sword if cooking for blockheads is installed. It might not be good practice to avoid registering an item for all I know, so if there are any other alternatives I'd love to hear them. Thanks for your time!
-
[1.15.2] Why is my Common config being read from the physical client over the physical server?
Thank you so much for all your help, I finally got it to work and I really appreciate the help given.
-
Block texture not loading when placed
Do you have a block item setup? If so is the texture applying to that?
-
[1.15.2] Help setting up a packet sent from the server
Removing the interface broke the way I was registering it, I rewrote how it's registered and it worked, thanks for making me check
-
[1.15.2] Help setting up a packet sent from the server
Thanks for pointing that out I removed it, sorry about that I took it from some source code I'd seen. Thanks for your reply, do you know why this isn't working? public class ConditionsMessage { private double dodgePower; public ConditionsMessage() { } public ConditionsMessage(double dodgePower) { this.dodgePower = dodgePower; } public void encode(ConditionsMessage message, PacketBuffer buffer) { buffer.writeDouble(message.dodgePower); } public ConditionsMessage decode(PacketBuffer buffer) { return new ConditionsMessage(buffer.readDouble()); } public void handle(ConditionsMessage message, Supplier<Context> supplier) { supplier.get().enqueueWork(() -> { DodgeEvents.dodgePower = message.dodgePower; }); supplier.get().setPacketHandled(true); } }
-
[1.15.2] Help setting up a packet sent from the server
Thanks for the help! That's fixed one of my problems now I just need help to sort out what's wrong with my packets.
-
[1.15.2] Help setting up a packet sent from the server
I have setup a packet handler using Forge's SimpleImpl documentation and by looking at other mods' source code. I want to send a packet containing common config values from the server to the client however my current code isn't working and I don't know what to do with it. I don't know how to send my variables across. ConditionsMessage.java public class ConditionsMessage implements IMessage<ConditionsMessage> { public static double dodgePower; @Override public void encode(ConditionsMessage message, PacketBuffer buffer) { } @Override public ConditionsMessage decode(PacketBuffer buffer) { return new ConditionsMessage(); } @Override public void handle(ConditionsMessage message, Supplier<Context> supplier) { supplier.get().enqueueWork(() -> { // Get dodgePower from ConfigHandler class somehow // originally was dodgePower = ConfigHandler.dodgePower; }); supplier.get().setPacketHandled(true); } } Where I send my packet in my main mod class @SubscribeEvent public void onServerStarting(FMLServerStartedEvent event) { PacketHandler.instance.send(PacketDistributor.ALL.noArg(), new ConditionsMessage()); } PacketHandler.class public class PacketHandler { private static final String PROTOCOL_VERSION = "1"; private static int nextId = 0; public static SimpleChannel instance; public static void init() { instance = NetworkRegistry.ChannelBuilder .named(new ResourceLocation(Dodge.MODID, "network")) .networkProtocolVersion(() -> PROTOCOL_VERSION) .clientAcceptedVersions(PROTOCOL_VERSION::equals) .serverAcceptedVersions(PROTOCOL_VERSION::equals) .simpleChannel(); register(ConditionsMessage.class, new ConditionsMessage()); } private static <T> void register(Class<T> clazz, IMessage<T> message) { instance.registerMessage(nextId++, clazz, message::encode, message::decode, message::handle); } } Init() ran from main mod class public MyMod() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ConfigHandler.COMMON_SPEC); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onCommonSetup); MinecraftForge.EVENT_BUS.register(this); } private void onCommonSetup(FMLCommonSetupEvent event) { PacketHandler.init(); } I'd really appreciate any help given as I've been suck on this for a while.
-
[1.15.2] Why is my Common config being read from the physical client over the physical server?
Oh I see thanks for explaining that one, what event should I call it in?
-
[1.15.2] Good resources for learning Forge Networks and Capabilities?
I'm looking to get a more in-depth understanding of the two. I know the basics from source code and from the SimpleImpl Forge Documentation and The Capability System but I can't figure out how to achieve what I'm trying to do, which is store a cooldown meter in my player using NBT and send information from the server's common config to the player.
IPS spam blocked by CleanTalk.