-
Posts
297 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Alpvax
-
-
3 hours ago, Alpvax said:
Forge only loads jar files
18 minutes ago, Fuyuno Sora said:I don't want forge to open it by some chance
It is no longer a jar file, so won't be opened by forge.
An alternative would be to just move the file to a different folder on the system. Or just delete it and download it again later if you want to start using it (Possibly a better option anyway, because the mod might be updated in the meantime, and it's not a good idea to play the same world with different mods to before).
-
You have set the player's pose at the end of every tick, because minecraft updates the player pose every tick. You will probably also need to do some extra work to support custom poses.
Check out my mod GoProne (github). If you copy/paste stuff from it please make sure you credit me.
-
Your best bet would probably be to look at Shulkers in the vanilla code. They are the only entities that I know of which directly move the player.
-
1 hour ago, CHEESEBOT314 said:
When creating the new TileEntityType store it in a public static final field and use that instead of the old one.
Or better still, use ObjectHolder or DeferredRegistry. There are plenty of topics on both if you search this site.
-
Changing the file extension doesn't affect the file, it's just a name. However, trying to open a changed file could cause whatever program usually opens it to fail (File being "unusable").
Basically, don't try to open a file with a renamed extension, and you won't have any issues.
-
You can simplify it, you are checking whether it is present twice:
//Either IAllergies allergies = allergiesLazyOptional.orElseGet(CapabilityAllergies::new); //Or IAllergies allergies = allergiesLazyOptional.orElse(new CapabilityAllergies());
The whole point of the "orElse" methods is to do something else if it is not present.
`CapabilityAllergies::new` is the same as `() -> new CapabilityAllergies()`: A method which takes no arguments and returns an instance of CapabilityAllergies.
-
Alternatively, you could rename the jar file (make sure file extensions are enabled) to <mod>.jar.disabled.
Forge only loads jar files, and that trick has been used by many modpacks/launchers in the past (for example Twitch launcher).
-
45 minutes ago, Kfir40Forge said:
You can also use MultiMC to install Twitch modpacks without using the Twitch launcher.
I believe that isn't the case any more, with forge >= 1.13 (since the complete rewrite) unless something has changed recently.
-
Why? What are you trying to accomplish?
There is a version of minecraft that has this feature: it's the server.
-
Have you checked that your TileEntity is actually being registered and created?
-
8 minutes ago, Time said:
if (e.getEntity == mc.player) {
I am assuming mc is Minecract.getInstance().
If that is the case, how would you expect it to work on a server? Minecraft is a client only class.
-
1
-
-
Unfortunately, I believe your only approach is to have either a custom leaf block (because you can't override the properties of vanilla blocks) or a custom log block which would set nearby leaves to non-persistent when it is removed, and generate the leaves with persistent set (which would be more prone to bugs such as breaking player placed leaves, or leaving behind leaves if the player breaks the link between the leaves and the trunk).
-
12 minutes ago, Nurox said:
Is there a better way to verify that the entity is a sapling?
Checking for the word "sapling" means your mod won't work in any language except English, so that's a really bad idea.
Is there a sapling tag? (hint: there is: #minecraft:saplings)
12 minutes ago, Nurox said:Should I be using a different event?
I want the item to spawn, wait like 600 ticks,...
The approach that I would probably use is a capability in one of 2 ways:
Either on the item (add using the event and check for saplings there), or on the EntityItem (check the entity is entityitem with contained sapling).
Then subscribe to the entity tick event and check the capability (or check it's an entityItem, then check the item has the capability). Use the capability to store your 600 tick cooldown, then plant the sapling.
-
I'm afraid we need more than a line number... What is the exception?
-
3 hours ago, DavidM said:
I don’t think this will ever be possible (or at least not in the way Forge is currently).
Mods have a lot of capabilities. Although some mods only add content into the game (which still relies on the registry events at startup), there are mods whose functionality relies on doing stuff during FML setups or during game startups, and others that alters the entire game (and have to be loaded from startup).
By not restarting the game, these mods will not work properly.
I believe part of the reason for forge moving to an event-based registration approach was to begin to make things possible. If everyone created and registered everything at the correct time (in the events), it wouldn't be too much of a stretch to begin working on hotloading (restore vanilla registry state, re run registry events, continue). However, it is not really a priority for anyone, and isn't feasible until everyone starts playing by the rules.
-
1
-
-
Make sure you only render once per tick. The RenderGameOverlayEvent fires for each HUD element, pick one to use.
-
I believe this error appears if you aren't sending any packets, and so haven't registered a network channel.
-
3 minutes ago, Narlecks said:
LiteralCommandNode<CommandSource> command = dispatcher.register( Commands.literal(Main.MODID) .then(PointsCommand.register(dispatcher)) ); dispatcher.register(Commands.literal(Main.MODID).redirect(command));
Is this what you actually meant to do? Just register the command you have created, instead of redirecting it to itself.
5 minutes ago, Narlecks said:public void onServerStarting(FMLServerStartingEvent event) { CommandHandler.register(event.getCommandDispatcher());
Yup, you are registering it on the server, so any packets you send need to be from the server to the client (HINT: you have the correct client to send to passed into your 'run' function).
Perform your logic directly in the 'run' function of your command, and if you need it on the client, send a packet to just update the client with the new value (don't do any calculation on the client, do it on the server and send the result).
-
Then you need to create a custom IRecipe type, which checks whether or not the player has the advancement as part of the recipe. Last time I looked, the only way to get the crafting player was by reflection (although that was a while ago).
-
Oh dear, I can see multiple issues with your code:
What on earth are you trying to achieve with this?
2 minutes ago, Narlecks said:if(Integer.class.isInstance(pQuantity))
This will never work. If you are on the server (i.e. trying to send a message to the client), you CANNOT use Minecraft.getInstance().
2 minutes ago, Narlecks said:Minecraft.getInstance().player.sendMessage(...);
Also, I'm pretty sure most (if not all, I haven't looked in a while) commands run on the server, so you shouldn't need to send packets (unless you need to update the client(s)).
Please show where PointsCommand::register is called (just to check that it is being registered on the server).
-
23 hours ago, OnePound said:
I want to be able to simulate the mod not being present - just OCD really.
That is a really bad idea.
If your mod does nothing, there's no point having it installed.
If your mod does something, it should show up in the mod list. Otherwise, if there is a strange interaction between your mod and another one, it becomes very hard to find the problem (because the users don't know they have your mod installed).
-
13 hours ago, Kiljaeden053 said:
Ahh ok. How about hitboxes having child hitboxes?
Try looking at the ender dragon code. I havent looked in a long time (so it could well have changed) but it used to be made up of multiple parts.
-
1 minute ago, ninjatdx said:
I wanted my mod to only load if the main mod is loaded as well otherwise it would be kinda weird
Use the dependencies in mods.toml. If they aren't satisfied, the mod won't load and the user will be shown an error
-
Show where you are sending your packet (the command).
If you send the packet to the client, it will be handled on the client, so the server won't get updated.
WorldSavedData vs World Capability
in Modder Support
Posted
I know how to use both WorldSavedData and Capabilities, having used both in the past.
One thing I am confused by is when to use each for data attached to the world. I understand that capabilities are better for optional cross-mod dependencies, but what is the advantage of WorldSavedData? Is it just the simplicity and the fact that WSDs predate capabilities?