Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. Several ways. Why not take a look at the net.minecraftforge.event package and sub-packages? There is definitely an event for what you want.
  2. I'm sorry what? Its Nonnull and part of a NonNullSupplier but you're returning null... Also did you make sure to register your Capability.
  3. Post your code. I'm not gonna watch a YouTube video to see what potentially is your code.
  4. Considering that the register event is running on that bus you will need two event handlers.
  5. No you cannot. The server doesn't have capabilities. Because there is only one server in question. It's not that complicated... Use events such as ServerStartingEvent to create a file if it doesnt exist(muted.json). Then whenever you run your mute command save the data to the file using Gson. If you dont want it to save when you run the command use the ServerStoppingEvent to save the data you have.
  6. This is not true as there are two different event buses. The mod event bus is incorrect for this event. Either dont specify one or change it to Bus.FORGE(the default one).
  7. @SubscribeEvent public static void onCommonSetup(FMLCommonSetupEvent event) { CapabilityManager.INSTANCE.register(IMoreHealth.class, new MoreHealthStorage(), MoreHealth::new); } This won't run I don't think. You should register it in your constructor like so. FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onCommonSetup);
  8. I think it is your Capability instance that is null. Show where you register it.
  9. Think basic Java file creation. Look up some tutorials on Gson if you need it. Use the ServerStartingEvent or ServerStartedEvent. Then everytime the command is run update the file.
  10. Don't register your Capability in the @Mod files constructor instead do it in the FMLCommonSetupEvent.
  11. Learn java. Do you know the difference between a static method and a non static method?
  12. The problem is that the BlockCrops is expecting your Block to have it's AGE property on it when it doesn't. So you'll have to not extend that class or use its AGE property.
  13. LazyOptional is the type that you need to return yes. But is IMana a LazyOptional instance? No therefore you can't cast it into a LazyOptional. You need to have a LazyOptional instance in your ICapabilityProvider.
  14. Yes it would be. Technically. The ICapabilityProvider is attached to the entity and it stores the "instance" field. Yes every time an entity is created it attaches a new ICapabilityProvider to that entity.
  15. Your IMana instance in your provider can't be static if you are gonna use MANA.getDefaultInstance(). You can't do this either don't know if I'm looking at outdated code or not.
  16. It matters because there are final fields in the Block class that aren't set unless you call the super. Add them to the list in their constructor? Also I think he was also pointing out that having two lists is pointless. Post your updated code.
  17. You might not understand how a LazyOptional works take a look at this thread.
  18. You dont. ops.json is for oped players you wouldn't use it for this. Create a file in the server directory called muted.json and save that file when the world saves? You would use the Gson library minecraft uses for its json interactions. I dont think the vanilla ban command let's you ban people that aren't online unless it's with IPs.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.