• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I am trying to add NBT to my item, I want it to store the int tankAir but I can't figure it out.. How would I go about adding this to the item.   package ronaldi2001.moreitems.Items; import java.util.List; import javax.annotation.Nullable; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.Entity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.World; import ronaldi2001.moreitems.MoreItems; public class AirTank extends Item{ public int playerAir; boolean Swimming; public int tankAir = 0; public int addAir; public int MaxtankAir; boolean active; public AirTank(String name, int Max, int Add) { super(new Item.Properties() .group(MoreItems.moreitemsitems) .maxStackSize(1) ); setRegistryName(name); MaxtankAir = Max; addAir = Add; } @Override public void inventoryTick(ItemStack stack, World worldIn, Entity player, int itemSlot, boolean isSelected) { playerAir = player.getAir(); Swimming = player.isInWater(); if(Swimming == false && playerAir == 300) { active = false; if(tankAir != MaxtankAir) { tankAir = tankAir + addAir; } } else { if(playerAir < 240 && tankAir > 0) { tankAir--; player.setAir(player.getAir() + 1); active = true; } if(tankAir == 0) { active = false; } } } @Override public void addInformation(ItemStack itemStack, @Nullable World world, List<ITextComponent> tooltip, ITooltipFlag flag) { tooltip.add(new TranslationTextComponent(TextFormatting.YELLOW + "Air: " + String.valueOf(Math.round((tankAir * 100) / MaxtankAir)) + "%")); } public boolean hasEffect(ItemStack par1ItemStack){ return active; } }  
    • i was able to launch the daemon outside of the folder but now i get this reply:   FAILURE: Build failed with an exception. * What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.9/userguide/gradle_daemon.html Please read the following process output to find out more: ----------------------- Error occurred during initialization of VM Could not reserve enough space for 3145728KB object heap * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    • You need to open the console in your project folder. You can either do Shift+Right Click (once in your folder) and open the console from there or do the "CD <path>" command in the console to your project folder. Note that gradlew isn't a Gradle command. It comes with the Forge zip file (the one you use for your project). That is why gradlew is unknown if you try to execute the command outside of your project folder. Reminder of the steps:    
    • I want to create a server so me and my friends can play together. I can't seem to get twilight forest working on the server. The mod is in both the client and server "mods" folder. 
    • I use LivingSpawnEvent.SpecialSpawn to make all armor-able mobs spawn with my mod's armor instead of vanilla armor, same for weapons. The code works perfectly fine for anything that is not a Zombie Pigman or a Wither Skeleton. The current issue with these two mobs is that they will correctly have the modded swords if I spawn them via spawn egg or if they enter the Overworld via portal, but they will not spawn with modded swords in the Nether. I can check via log if a mob has recently spawned naturally and was re-armed in the Nether during the re-arming event and it will say something like "Wither Skeleton at XYZ spawned with Mod Sword" and when I teleport to that mob it will have its vanilla sword and not the modded sword. Another issue is that overworld mobs will rarely ignore the re-arming event and spawn with vanilla armor, which I don't understand.
  • Topics

  • Who's Online (See full list)