Jump to content

Terrails

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Terrails

  1. I'm using Mcjty's tutorial for rendering Tile Entity with a custom OBJ model, but my model just won't get loaded, the log tells me: Exception loading model with loader VanillaLoader.INSTANCE, than it skips loading the .obj file and goes and tries to find .obj.json file which doesn't exist. The Log
  2. Thank you! Everything works perfectly right now. Only problem was to the duration for the effect was in ticks so I just multiplied it by 20 to it goes back to 300 seconds instead of 15 seconds. I was just wondering is there a way to make the effect not disappear even when you drink milk, so if someone gets poison he drinks milk and gets rid of it but my effect still stays. For now I'm just using the RightClickItem event so you cannot right click milk.
  3. I fixed everything and now I'm trying to get the RightClickBlock for cake's, I just cannot find anything to specify a block I right clicked.
  4. This works perfectly... the problem is to I can't see the potion countdown in my inventory, I only see its particles even though I added the texture's for the potion. @SubscribeEvent public void applyEffect(PlayerEvent.Clone player) { if (player.isWasDeath()) if (ConfigHandler.noEating) player.getEntityPlayer().addPotionEffect(new PotionEffect(ModPotions.appetite, ConfigHandler.noEatingTime)); } @SubscribeEvent public void itemInteract(PlayerInteractEvent.RightClickItem event) { if (ConfigHandler.noEating) if (event.getItemStack().getItemUseAction() == EnumAction.EAT) if (event.getEntityPlayer().isPotionActive(ModPotions.appetite)) event.setCanceled(true); } PotionDefault Class public class PotionDefault extends Potion { private static final ResourceLocation POTIONS_LOCATION = new ResourceLocation("keephunger:textures/potions/inventory.png"); protected PotionDefault(boolean isBadEffectIn, int liquidColorIn, int x, int y) { super(isBadEffectIn, liquidColorIn); this.setIconIndex(x, y); } @Override @SideOnly(Side.CLIENT) public boolean hasStatusIcon() { Minecraft.getMinecraft().getTextureManager().bindTexture(POTIONS_LOCATION); return super.hasStatusIcon(); } } No Appetite Effect public class NoAppetiteEffect extends PotionDefault { public NoAppetiteEffect(int id) { super(true, 0x8DCDA3, 1,1); } } ModPotions Class public class ModPotions { public static Potion appetite; public static void init() { appetite = registerPotion("appetite", new NoAppetiteEffect(26).setPotionName("potion.appetite")); } public static Potion registerPotion(String name, Potion potion) { GameRegistry.register(potion, new ResourceLocation(MainClass.MODID, name)); return potion; } public static PotionType registerPotionType(String name, PotionType potionType) { GameRegistry.register(potionType, new ResourceLocation(MainClass.MODID, name)); return potionType; } }
  5. I did this for now, but I cannot right click with anything anymore. Its probably because the EnumAction.EAT needs to be in the RightClickItem event but I don't know how to put it there, I can't find any event type for EnumAction in RightClickItem. And how do I merge RightClickItem and PlayerEvent.Clone together? I never placed 2 Events into SubscribeEvent. @SubscribeEvent public void InteractItem( PlayerInteractEvent.RightClickItem event) { if (ConfigHandler.noEating) event.setCanceled(true); } public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.EAT; } @SubscribeEvent public void FoodEat(PlayerEvent.Clone event) { if (ConfigHandler.noEating) { if (event.isWasDeath()) { event.getEntityPlayer().addPotionEffect(new PotionEffect(MainClass.appetiteEffect, ConfigHandler.noEatingTime)); } } } If I try to put event.getItemStack().getItemUseAction(EnumAction.EAT); into the RightClickItem event it gives me an error (It cannot be applied to EnumAction)
  6. I want to make an event when player die's to he can't eat for specified time. I'm using PlayerEvent.Clone for the isWasDeath in IF so when player dies it does that to he can't eat for specified time. But I can't seem to find any kind of timer to make a player not eat in getEntityPlayer.
  7. I'm trying to make a mod which makes a player respawn with his last food/hunger level (like tinkers did in 1.7) but I can't seem to make it work. I try to get original player food level, after that I just put it in the EntityPlayer with setFoodLevel. this is what I tried for now @SubscribeEvent public void keepHunger(PlayerEvent.Clone player) { if (player.isWasDeath()) { int level = player.getOriginal().getFoodStats().getFoodLevel(); player.getEntityPlayer().getFoodStats().setFoodLevel(level); } } EDIT: Fixed by doing the registry properly.
  8. I can confirm to it works with 376.33 drivers
  9. Yep I tried it on curse and it worked normally, its really weird, in modding environment it doesn't work and on normal launchers it works.
  10. I can confirm to the same thing is happening to me, maybe its the new nvidia drivers because I started to get this error after driver update. I'll try to downgrade the drivers
×
×
  • Create New...

Important Information

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