Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Alpvax

Members
  • Posts

    257
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Alpvax

  1. Yes, but with that approach being a supplier, I am correct in thinking that it won't? Would using the delegate fix it, or is a RegistryObject the correct approach?
  2. The only thing I am unsure of with that approach (dieseiben could probably clarify) is whether that continues to work if someone replaces the vanilla entity type.
  3. RegistryObject.of(resourceLocation-of-entitytype, ForgeRegistries.ENTITY); If you change it to receive a Supplier<? extends EntityType<? extends LivingEntity>> instead of having to be a RegistryObject, then you could pass in the vanilla types as () -> VANILLA_TYPE. You could change your existing method to create the registry object or supplier and pass it into the other method.
  4. What other script? Did you look at my code? You need to use Reflection, or an access transformer to set the pose. You need to set the pose on the server (you need to send a packet when the button is pressed/released). Which means you need to keep track of which players should be prone, and set the pose of each of them in a PlayerTickEvent.
  5. Probably true, but as the initial code created a new capability if there wasn't an existing one, I repeated that functionality.
  6. So is there a recommendation for most cases, or does it not really matter?
  7. You probably need to call super#tick at some point.
  8. My mistake, I didn't have access to the code at the time. It should be either .orElseGet(CapabilityAllergies::new) or .orElse(new CapabilityAllergies()). The difference is that the first option will not create a new instance unless it is required, whereas the second will regardless. (Which you use will probably only result in a minor performance difference).
  9. 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?
  10. 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).
  11. 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.
  12. 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.
  13. Or better still, use ObjectHolder or DeferredRegistry. There are plenty of topics on both if you search this site.
  14. 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.
  15. 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.
  16. 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).
  17. I believe that isn't the case any more, with forge >= 1.13 (since the complete rewrite) unless something has changed recently.
  18. Why? What are you trying to accomplish? There is a version of minecraft that has this feature: it's the server.
  19. Have you checked that your TileEntity is actually being registered and created?
  20. 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.
  21. 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).
  22. 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) 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.
  23. I'm afraid we need more than a line number... What is the exception?
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.