Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

cinsiian

Members
  • Joined

  • Last visited

Everything posted by cinsiian

  1. I cannot find any of these events in my forge
  2. I am using the version 28.1.10
  3. Do I have to register it via MinecraftForge.EVENT_BUS ?
  4. @EventBusSubscriber public class Handler { @SubscribeEvent() public static void drop(HarvestDropsEvent event) { Block block = event.getState().getBlock(); Random rand = new Random(); if(block instanceof TallGrassBlock && !event.isSilkTouching()) { int gen = 1 + rand.nextInt(100); int extra = 1 + rand.nextInt(50); if(gen < 51) {event.getDrops().add(new ItemStack(Items.PLANT_FIBER));} if(extra < 14) {event.getDrops().add(new ItemStack(Items.PLANT_FIBER));} } if((block == Blocks.GRASS || block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL || block == Blocks.MYCELIUM) && !event.isSilkTouching()) { int gen = 1 + rand.nextInt(100); int extra = 1 + rand.nextInt(50); if(gen < 21) {event.getDrops().add(new ItemStack(Items.PLANT_FIBER));} if(extra < 14) {event.getDrops().add(new ItemStack(Items.PLANT_FIBER));} } } } Okay basically this event is not getting registered, whats the problem?
  5. Oh I made the block in the event and now works. Thank you
  6. public Block dirt_gravity = new GravityBlock(Blocks.DIRT).setRegistryName(Blocks.DIRT.getRegistryName()); @SubscribeEvent public void register_block(RegistryEvent.Register<Block> event) { event.getRegistry().register(dirt_gravity); } @SubscribeEvent public void register_item(RegistryEvent.Register<Item> event) { event.getRegistry().register(new BlockItem(dirt_gravity, new Item.Properties()).setRegistryName(Blocks.DIRT.getRegistryName())); } still nothing
  7. event.getRegistry().register(new GravityBlock(Blocks.DIRT).setRegistryName(Blocks.DIRT.getRegistryName())); I tried also with new ResourceLocation("minecraft", "dirt") but nothing is happening :8 Do I have to make an itemblock as well?
  8. event.getRegistry().register(new GravityBlock(Blocks.DIRT).setRegistryName("dirt")); Nothing is changed. Am I doing something wrong?
  9. I assume I didnt override the block correctly?
  10. Hello, how can i make some vanilla blocks affected by gravity? Is it possible? Like in a registry event do I check the block and then make it extends FallingBlock? Thank you
  11. Hello. I need to cast an Entity to another entity wich can grab items/wear armor. How is this entity type called? I need that to check the armor slots. Than you
  12. oh my bad, i forgot to move the rendering method. Thank you everything is fixed.
  13. Do horse health work like player health? Because I'm checking if the health > 20 and nothing happens(The horse has 2 health bars)
  14. No its not, in 1.13 mojang made that you need to regenerate the air outside the water. But yea, I fixed it. Now I just need to know
  15. Its in the spoiler.. i just need to hide the air bar when the player's air is regenerating
  16. Hello, so I made a custom bar above the hunger bar, and sometimes it overrites vanilla's guis. I already managed to move it up if the player is swimming/in water to make the air bar appear. The problem is that when you get out the water the air bar keeps getting shown and i need to hide it. I tried to do that but it doesnt work: I also need to check if the player is rinding an entity and get the entity's health. In this case i will check if the health is > 2, and then if its true, render my hud above the entity health's bar. How can I do that? Thanks.
  17. Hello everyone, So basically when I summon my lightning, the effect doesnt come out, it just spawns the fire where the lightning should spawn. This is the code that im currently using: Do I have to send something to the client? Thanks for help.
  18. I dont think this is the correct way to save values, just use the player and the world(player.getEntityWorld) provided by the event. I suggest to use a PlayerInteractEvent instead of InputEvent, you can get the player/world from there.
  19. I finally did it, I managed to get it work, thanks everyone for the help! Marking this as solved. Thanks everyone again!!!!
  20. Oh I get it, I have to set the server's player mana using the constructor in a network event. Am I right?
  21. Ok but i dont need the client player, i need the server player wich I can get the capability and set the Packet.mana for the client (Server > Client)
  22. So how can I get the normal player?

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.