Jump to content

vemerion

Members
  • Posts

    390
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by vemerion

  1. Try overriding the remove method in the ColoredSlimeEntity and setting the color of the new children to the same color as the parent.
  2. You could listen to the LivingHurtEvent event and cancel it if the entity is a player.
  3. Strange, maybe try to just search for *.api.Event or *forge*.Event . It is a little bit finicky to find the event class, since there are a lot of different event classes from different irrelevant libraries which we do not want. The method Draco explains should also work, don't forget to right click on the Event class in the type hierarchy tree and select Focus On 'Event'.
  4. You might have to specify the path to the jdk (and the jre that comes with it), but I think it does so automatically when installing java. You can check the location of java the eclipse is using under Window -> Preferences -> Java -> Installed JREs.
  5. If you are using eclipse (but presumably other IDEs have similar functionality) you can view all events by: Pressing ctrl+shift+t to and search for the net.minecraftforge.eventbus.api.Event type Click on the class name and press F4 to open the Event type hierarchy, where you can view all events
  6. No problem, glad I could help!
  7. Something similar has also happened to me once, and I am not quite sure what was wrong, but here is what I did to fix it: Reinstalled the JDK Downloaded an older version of eclipse (I think I ended up using eclipse-2018-12) Made sure that the eclipse installation, the JDK, and the workspace were on the same disk volume Ran the eclipse and genEclipseRuns tasks in the terminal before importing the project to eclipse Hope this helps!
  8. I think the problem is that the superclass LeavesBlock tries to set the default state for DISTANCE in its constructor, which unfortunately does not exist anymore due to the fact that you have overriden fillStateContainer. To fix this, change the string name of your DISTANCE variable, like so: public static final IntegerProperty DISTANCE = IntegerProperty.create("distance2", 1, 11); and also change fillStateContainer to the following: @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(DISTANCE); super.fillStateContainer(builder); } Hopefully that will work.
  9. No problem, glad I could help!
  10. ClientTickEvent is fired on the Forge bus, try changing bus = Mod.EventBusSubscriber.Bus.MOD to bus = Mod.EventBusSubscriber.Bus.FORGE
  11. No problem! Happy modding
  12. Try casting the world instance first, like so: ServerWorld world = (ServerWorld) target.getEntityWorld();
  13. Assuming that it has not changed since 1.15, EntityInteract is fired on both logical sides. This means that when it is fired on the client side, the world will be a ClientWorld (remember that ClientWorld is a subclass of World), and thus addParticle will be implemented and work, which it why it works for the Rats mod. The onLivingHurt event however only fires on the server, I believe. Edit: To create particles from the server, use the spawnParticle method instead of addParticle (as I now see that the Rats mod does), which should also send the particles to the client.
  14. This would play your music once every 1000 ticks (every 50 seconds): private static int musicTimer = 1000; @SubscribeEvent public static void onTick(ClientTickEvent event) { if (event.phase == Phase.END && event.side == LogicalSide.CLIENT) { if (musicTimer-- <= 0 && Minecraft.getInstance() != null && Minecraft.getInstance().player != null) { musicTimer = 1000; Minecraft.getInstance().player.playSound(YOUR MUSIC HERE, 2f, 1f); Minecraft.getInstance().getMusicTicker().stop(); } } } Although I think the vanilla Minecraft music could potentially start while your music is playing, so you would have to handle that also.
  15. You could register your own SoundEvents as detailed here, and then for example play those SoundEvents (your music) in a tick event at random.
  16. No problem, I am just glad to help. Happy modding!
  17. You could listen to the event BlockEvent.CropGrowEvent.Pre to slow down growth speed.
  18. It seems like you first have to register the attribute, like so: this.getAttributes().registerAttribute(SharedMonsterAttributes.ATTACK_DAMAGE);
  19. I think you have to also set the ATTACK_DAMAGE attribute in your registerAttributes() method.
  20. Alright, thanks for the info!
  21. Are you sure? I thought the order was Blocks -> Items -> Everything else in alphabetical order.
  22. onEntityWalk detects when an entity is on top of a block, if that is what you need.
  23. I suspect the methods work, but that you are mistaken about when they should trigger. onEntityCollision is supposed to only trigger when the entity is inside, and onBlockClicked only triggers for left click, use onBlockActivated for right click.
  24. If you are fine with just hiding the top right potion icons and the particles (but not the inventory screen effect), you can utilize the onRenderGameOverlay and onPotionColorCalc events, respectively.
  25. Did you run the eclipse task or only genEclipseRuns? To be honest, if I were you I would redo the project and follow a tutorial such as this to the letter, and see if that works.
×
×
  • Create New...

Important Information

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