I understand that the potion of blindness was never implemented and as such does not have an ID, but I wanted to add a crafting recipe for it in a mod I'm working on. Is there any way of making this work?
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
My experience there is limited, but as a workaround I would make a custom item, maybe called ItemPotionBlindess. Then I would do whatever code vanilla Potions use for textures and use the onEaten() method to give the character the blindness potion effect. Then, of course, set up the crafting recipe for your custom Item.
If it's also able to be thrown (splash potion), jabelar has a tutorial for an item that activates on being thrown. I have not looked at the splash potion code, but that might also help.
Good luck!
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
My experience there is limited, but as a workaround I would make a custom item, maybe called ItemPotionBlindess. Then I would do whatever code vanilla Potions use for textures and use the onEaten() method to give the character the blindness potion effect. Then, of course, set up the crafting recipe for your custom Item.
If it's also able to be thrown (splash potion), jabelar has a tutorial for an item that activates on being thrown. I have not looked at the splash potion code, but that might also help.
Good luck!
Ok, I'm making it a custom throwable item that when impacting an entity, plays the glass breaking noise and gives them the blindness effect for 30 seconds.
In other words, it only acts like a splash potion.
Ok, I can throw the potion, but the thrown potion entity does not render. Also, how can I get it to apply a potion effect to an entity hit by it?
ClientProxy:
package net.sargeant.rapad;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.sargeant.rapad.entity.EntityBlindSplash;
import net.sargeant.rapad.items.ModItems;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
public class ClientProxy extends CommonProxy
{
@Override
public void preInit(FMLPreInitializationEvent e) {
// TODO Auto-generated method stub
super.preInit(e);
}
@Override
public void init(FMLInitializationEvent e) {
// TODO Auto-generated method stub
super.init(e);
}
@Override
public void postInit(FMLPostInitializationEvent e) {
// TODO Auto-generated method stub
super.postInit(e);
}
@Override
public void registerRenderThings()
{
RenderingRegistry.registerEntityRenderingHandler(EntityBlindSplash.class, new RenderSnowball(ModItems.blindsplash));
}
@Override
public void registerSounds() {}
}
EntityBlindSplash.java:
package net.sargeant.rapad.entity;
import java.util.Iterator;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.world.World;public class EntityBlindSplash extends EntityThrowable
{
/*
* If you're wondering why I have all of
* these constructors for no reason, It's
* used by Forge to use this class, If you
* don't have these, your minecraft is going
* to crash!
*/
public EntityBlindSplash(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
public EntityBlindSplash(World par1World, EntityLivingBase par2EntityLivingBase)
{
super(par1World, par2EntityLivingBase);
}public EntityBlindSplash(World par1World)
{
super(par1World);
}
@Override
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition mop)
{
//If this hit's a block, continue
if(mop.typeOfHit == MovingObjectType.BLOCK)
{
/*
* You might be wondering what
* all these case and break are
* These are use to switch the number
* mop.sideHit
*
* Example:
* If mop.sideHit == 3 whatever is in
* case 3 Happens!
*/
switch(mop.sideHit)
{
case 0: //BOTTOM
mop.blockY--;
break;
case 1: //TOP
mop.blockY++;
break;
case 2: //EAST
mop.blockZ--;
break;
case 3: //WEST
mop.blockZ++;
break;
case 4: //NORTH
mop.blockX--;
break;
case 5: //SOUTH
mop.blockX++;
break;
}
//If the Server is online and works, kill this entity
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}
}
ItemBlindSplash.java:
package net.sargeant.rapad.items;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.sargeant.rapad.entity.EntityBlindSplash;
public class ItemBlindSplash extends Item
{
public ItemBlindSplash()
{
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
//This if statement is here to check that the Server is working
if (!par2World.isRemote)
{
/* This method in World spawn in an entity,
* You can use with anything that extends
* the Entity class, in this case it's
* the EntityGrenade class
*/
par2World.spawnEntityInWorld(new EntityBlindSplash(par2World, par3EntityPlayer));
//Decrease an item from the stack because you used it!
--par1ItemStack.stackSize;
} return par1ItemStack;
}
/**
* Render Pass sensitive version of hasEffect()
*/
public boolean hasEffect(ItemStack par1ItemStack, int pass)
{
//This means it will look "special" in the inventory
return true;
}
}
You can specify custom potion effects for the vanilla potion item using NBT. Set the CustomPotionEffects tag to a list of compound tags that each contain the data of a single PotionEffect. Use PotionEffect#writeCustomPotionEffectToNBT to write a PotionEffect to a compound tag in the appropriate format.
A potion is a splash potion if bit 14 of the metadata is 1 (you can use 1 << 14 as the metadata if you're using NBT for the effects). If you don't want a splash potion, set bit 13 to 1 instead (potions only display their name and effects if the metadata isn't 0, but custom effects will still work regardless of the metadata). The wiki explains potion metadata in more detail.
Look at EntityPotion to see how splash potions apply their effects to entities.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
You can specify custom potion effects for the vanilla potion item using NBT. Set the CustomPotionEffects tag to a list of compound tags that each contain the data of a single PotionEffect. Use PotionEffect#writeCustomPotionEffectToNBT to write a PotionEffect to a compound tag in the appropriate format.
A potion is a splash potion if bit 14 of the metadata is 1 (you can use 1 << 14 as the metadata if you're using NBT for the effects). If you don't want a splash potion, set bit 13 to 1 instead (potions only display their name and effects if the metadata isn't 0, but custom effects will still work regardless of the metadata). The wiki explains potion metadata in more detail.
Look at EntityPotion to see how splash potions apply their effects to entities.
My code is in my previous post, the item appears in-game, and I can equip it. However, when I throw it, it doesn't render (instead causing a crash related to RenderSnowball).
My code is in my previous post, the item appears in-game, and I can equip it. However, when I throw it, it doesn't render (instead causing a crash related to RenderSnowball).
If it's crashing, post the crash report.
I'd still suggest looking at EntityPotion, it should show you exactly how to apply effects to nearby entities when it hits something.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'd still suggest looking at EntityPotion, it should show you exactly how to apply effects to nearby entities when it hits something.
My crash report is below. I'm not making it strictly the same way potions are coded, as that system is a bit too complicated for my level of coding expertise. It's simply going to be a throwable item that inflicts the potion effect on impact.
[12:28:48] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering entity in world
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:346) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251) ~[RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527) ~[RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300) ~[EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
Caused by: java.lang.NullPointerException
at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:43) ~[RenderSnowball.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) ~[RenderManager.class:?]
... 16 more
[12:28:48] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----
// I let you down. Sorry
Time: 11/17/15 12:28 PM
Description: Rendering entity in world
java.lang.NullPointerException: Rendering entity in world
at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:43)
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1067)
at net.minecraft.client.Minecraft.run(Minecraft.java:962)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Stacktrace:
at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:43)
-- Entity being rendered --
Details:
Entity Type: rapadmod.BlindSplash (net.sargeant.rapad.entity.EntityBlindSplash)
Entity ID: 654
Entity Name: entity.rapadmod.BlindSplash.name
Entity's Exact location: -152.56, 74.56, 189.12
Entity's Block location: World: (-153,74,189), Chunk: (at 7,4,13 in -10,11; contains blocks -160,0,176 to -145,255,191), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Entity's Momentum: -0.40, -1.33, 0.61
-- Renderer details --
Details:
Assigned renderer: net.minecraft.client.renderer.entity.RenderSnowball@4c255e8
Location: -0.23,-0.34,0.02 - World: (-1,-1,0), Chunk: (at 15,-1,0 in -1,0; contains blocks -16,0,0 to -1,255,15), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Rotation: -33.108513
Delta: 0.17221153
Stacktrace:
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:278)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:251)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:527)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1300)
-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player168'/437, l='MpServer', x=-151.99, y=75.98, z=188.59]]
Chunk stats: MultiplayerChunkCache: 385, 385
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options:
Level spawn location: World: (-204,64,256), Chunk: (at 4,4,0 in -13,16; contains blocks -208,0,256 to -193,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 14921 game time, 14921 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 146 total; [EntityItem['item.tile.dirt.default'/256, l='MpServer', x=-158.19, y=64.13, z=188.25], EntityItem['item.tile.dirt.default'/257, l='MpServer', x=-157.19, y=64.13, z=188.38], EntityItem['item.tile.dirt.default'/258, l='MpServer', x=-157.09, y=65.13, z=186.13], EntityItem['item.item.animalfat'/259, l='MpServer', x=-150.66, y=65.13, z=179.88], EntityItem['item.item.bone'/260, l='MpServer', x=-152.88, y=65.13, z=180.13], EntitySheep['Sheep'/261, l='MpServer', x=-153.28, y=69.00, z=191.50], EntityPig['Pig'/262, l='MpServer', x=-146.16, y=64.00, z=180.03], EntitySheep['Sheep'/264, l='MpServer', x=-147.26, y=74.00, z=199.31], EntitySheep['Sheep'/265, l='MpServer', x=-156.06, y=66.00, z=202.94], EntityCow['Cow'/268, l='MpServer', x=-129.88, y=116.00, z=122.75], EntityEnderman['Enderman'/269, l='MpServer', x=-136.13, y=67.00, z=172.50], EntityCow['Cow'/270, l='MpServer', x=-142.50, y=63.00, z=186.91], EntityPig['Pig'/271, l='MpServer', x=-139.03, y=63.00, z=180.94], EntityCreeper['Creeper'/272, l='MpServer', x=-138.28, y=26.00, z=220.84], EntityZombie['Zombie'/273, l='MpServer', x=-142.00, y=23.00, z=234.53], EntityItem['item.item.batguano'/274, l='MpServer', x=-137.66, y=25.13, z=237.44], EntitySkeleton['Skeleton'/275, l='MpServer', x=-138.34, y=39.00, z=253.50], EntityCow['Cow'/276, l='MpServer', x=-129.16, y=63.00, z=253.88], EntityZombie['Zombie'/278, l='MpServer', x=-127.89, y=42.00, z=266.50], EntityCow['Cow'/279, l='MpServer', x=-132.39, y=64.00, z=265.51], EntityCow['Cow'/290, l='MpServer', x=-113.63, y=107.00, z=134.59], EntityItem['item.item.herbivoredung'/291, l='MpServer', x=-117.66, y=103.13, z=136.63], EntitySquid['Squid'/292, l='MpServer', x=-115.29, y=56.38, z=171.21], EntitySkeleton['Skeleton'/293, l='MpServer', x=-120.42, y=21.00, z=224.88], EntitySkeleton['Skeleton'/294, l='MpServer', x=-121.50, y=31.00, z=219.50], EntityBat['Bat'/295, l='MpServer', x=-121.20, y=25.52, z=222.99], EntitySkeleton['Skeleton'/296, l='MpServer', x=-118.13, y=18.00, z=250.50], EntityZombie['Zombie'/297, l='MpServer', x=-113.16, y=19.00, z=250.31], EntityCreeper['Creeper'/298, l='MpServer', x=-126.06, y=16.00, z=251.59], EntityCreeper['Creeper'/299, l='MpServer', x=-113.44, y=21.00, z=240.97], EntityBat['Bat'/300, l='MpServer', x=-123.38, y=36.00, z=252.09], EntityBat['Bat'/301, l='MpServer', x=-113.69, y=21.10, z=259.66], EntityBat['Bat'/302, l='MpServer', x=-114.30, y=17.63, z=261.74], EntityCreeper['Creeper'/303, l='MpServer', x=-116.00, y=40.00, z=260.13], EntitySheep['Sheep'/304, l='MpServer', x=-117.53, y=67.00, z=268.13], EntityCow['Cow'/310, l='MpServer', x=-107.97, y=108.00, z=135.94], EntityCow['Cow'/311, l='MpServer', x=-110.47, y=102.00, z=137.47], EntitySquid['Squid'/312, l='MpServer', x=-110.42, y=56.00, z=164.48], EntitySquid['Squid'/313, l='MpServer', x=-111.39, y=56.82, z=164.50], EntityCow['Cow'/314, l='MpServer', x=-99.44, y=71.00, z=173.47], EntitySkeleton['Skeleton'/315, l='MpServer', x=-100.30, y=31.08, z=188.70], EntitySkeleton['Skeleton'/316, l='MpServer', x=-99.50, y=32.00, z=188.41], EntityPig['Pig'/317, l='MpServer', x=-101.46, y=64.96, z=189.50], EntityItem['item.item.herbivoredung'/318, l='MpServer', x=-103.38, y=62.13, z=188.03], EntityPig['Pig'/319, l='MpServer', x=-101.91, y=65.00, z=183.78], EntityItem['item.item.herbivoredung'/320, l='MpServer', x=-100.59, y=65.13, z=189.13], EntityItem['item.item.batcooked'/321, l='MpServer', x=-105.38, y=27.13, z=201.56], EntityBat['Bat'/322, l='MpServer', x=-108.50, y=29.10, z=206.27], EntityItem['item.item.herbivoredung'/323, l='MpServer', x=-105.41, y=58.13, z=198.22], EntityPig['Pig'/324, l='MpServer', x=-100.06, y=66.00, z=196.41], EntityPig['Pig'/325, l='MpServer', x=-100.53, y=64.00, z=195.94], EntityCow['Cow'/326, l='MpServer', x=-100.31, y=69.00, z=242.50], EntitySkeleton['Skeleton'/327, l='MpServer', x=-105.50, y=64.00, z=246.50], EntitySheep['Sheep'/328, l='MpServer', x=-99.50, y=64.00, z=265.25], EntityZombie['Zombie'/334, l='MpServer', x=-91.50, y=19.00, z=110.50], EntityZombie['Zombie'/335, l='MpServer', x=-87.84, y=38.00, z=119.91], EntitySkeleton['Skeleton'/336, l='MpServer', x=-93.50, y=118.00, z=117.50], EntityBat['Bat'/337, l='MpServer', x=-80.25, y=54.10, z=151.25], EntityZombie['Zombie'/338, l='MpServer', x=-93.48, y=51.49, z=148.50], EntityCow['Cow'/341, l='MpServer', x=-95.22, y=78.00, z=180.78], EntitySkeleton['Skeleton'/342, l='MpServer', x=-86.97, y=11.00, z=201.50], EntitySkeleton['Skeleton'/343, l='MpServer', x=-89.50, y=11.00, z=202.50], EntityCow['Cow'/344, l='MpServer', x=-92.97, y=78.00, z=197.88], EntityCow['Cow'/345, l='MpServer', x=-94.78, y=77.00, z=198.06], EntitySheep['Sheep'/346, l='MpServer', x=-93.50, y=69.00, z=238.22], EntityZombie['Zombie'/351, l='MpServer', x=-78.91, y=39.00, z=120.50], EntityBat['Bat'/352, l='MpServer', x=-73.88, y=39.29, z=128.76], EntityWitch['Witch'/354, l='MpServer', x=-72.88, y=46.00, z=145.47], EntityBat['Bat'/355, l='MpServer', x=-76.44, y=52.96, z=150.21], EntityBat['Bat'/356, l='MpServer', x=-76.25, y=55.10, z=153.25], EntitySpider['Spider'/358, l='MpServer', x=-72.50, y=48.00, z=162.25], EntityBat['Bat'/360, l='MpServer', x=-74.51, y=40.00, z=199.03], EntitySkeleton['Skeleton'/361, l='MpServer', x=-72.09, y=80.00, z=202.50], EntitySheep['Sheep'/138, l='MpServer', x=-227.31, y=80.00, z=154.50], EntityChicken['Chicken'/139, l='MpServer', x=-226.25, y=82.00, z=150.19], EntityBlindSplash['entity.rapadmod.BlindSplash.name'/654, l='MpServer', x=-152.56, y=74.56, z=189.12], EntitySkeleton['Skeleton'/143, l='MpServer', x=-225.09, y=19.00, z=233.50], EntityChicken['Chicken'/153, l='MpServer', x=-213.47, y=86.00, z=123.53], EntityChicken['Chicken'/154, l='MpServer', x=-217.16, y=79.00, z=133.76], EntityZombie['Zombie'/155, l='MpServer', x=-223.25, y=17.00, z=162.03], EntitySkeleton['Skeleton'/156, l='MpServer', x=-220.07, y=17.00, z=162.59], EntityCreeper['Creeper'/157, l='MpServer', x=-212.31, y=42.00, z=183.41], EntityCreeper['Creeper'/158, l='MpServer', x=-214.00, y=63.00, z=176.56], EntityCow['Cow'/159, l='MpServer', x=-208.03, y=64.00, z=183.91], EntityCreeper['Creeper'/160, l='MpServer', x=-214.24, y=22.00, z=197.08], EntityCreeper['Creeper'/161, l='MpServer', x=-214.03, y=24.00, z=207.50], EntitySkeleton['Skeleton'/162, l='MpServer', x=-211.84, y=48.00, z=205.25], EntityCreeper['Creeper'/163, l='MpServer', x=-221.06, y=63.00, z=192.38], EntitySkeleton['Skeleton'/164, l='MpServer', x=-219.50, y=20.00, z=222.50], EntityBat['Bat'/165, l='MpServer', x=-206.28, y=24.00, z=217.50], EntityBat['Bat'/166, l='MpServer', x=-216.61, y=20.88, z=221.51], EntityCreeper['Creeper'/177, l='MpServer', x=-205.50, y=52.00, z=138.50], EntityItem['item.item.animalfat'/178, l='MpServer', x=-202.81, y=63.13, z=140.41], EntitySheep['Sheep'/179, l='MpServer', x=-204.53, y=63.00, z=144.78], EntitySkeleton['Skeleton'/180, l='MpServer', x=-200.59, y=42.00, z=190.13], EntityItem['item.item.herbivoredung'/181, l='MpServer', x=-205.28, y=64.13, z=186.69], EntityClientPlayerMP['Player168'/437, l='MpServer', x=-151.99, y=75.98, z=188.59], EntityZombie['Zombie'/182, l='MpServer', x=-205.03, y=47.00, z=192.41], EntityBat['Bat'/183, l='MpServer', x=-207.38, y=25.10, z=219.75], EntityCreeper['Creeper'/184, l='MpServer', x=-202.41, y=40.00, z=222.00], EntityCreeper['Creeper'/185, l='MpServer', x=-196.75, y=43.00, z=226.94], EntitySkeleton['Skeleton'/188, l='MpServer', x=-178.50, y=53.00, z=142.50], EntityChicken['Chicken'/189, l='MpServer', x=-177.38, y=78.00, z=141.66], EntityItem['item.item.chickenguano'/190, l='MpServer', x=-190.47, y=73.13, z=136.66], EntityZombie['Zombie'/191, l='MpServer', x=-186.72, y=86.00, z=133.31], EntityChicken['Chicken'/192, l='MpServer', x=-176.46, y=93.00, z=130.85], EntityItem['item.item.chickenguano'/193, l='MpServer', x=-178.66, y=92.13, z=131.56], EntityChicken['Chicken'/194, l='MpServer', x=-185.59, y=80.00, z=135.47], EntitySpider['Spider'/195, l='MpServer', x=-176.93, y=29.00, z=148.78], EntityZombie['Zombie'/196, l='MpServer', x=-188.03, y=45.00, z=157.53], EntityCow['Cow'/197, l='MpServer', x=-187.23, y=62.00, z=186.50], EntityCow['Cow'/198, l='MpServer', x=-187.81, y=65.00, z=185.22], EntityItem['item.item.herbivoredung'/199, l='MpServer', x=-190.13, y=63.13, z=207.81], EntityZombie['Zombie'/200, l='MpServer', x=-192.47, y=29.50, z=221.57], EntitySheep['Sheep'/201, l='MpServer', x=-184.81, y=63.00, z=210.75], EntityCow['Cow'/202, l='MpServer', x=-190.88, y=63.00, z=210.06], EntityEnderman['Enderman'/203, l='MpServer', x=-177.38, y=64.00, z=212.47], EntityZombie['Zombie'/204, l='MpServer', x=-191.53, y=46.00, z=232.69], EntitySheep['Sheep'/205, l='MpServer', x=-185.13, y=69.00, z=233.25], EntityItem['item.item.batguano'/218, l='MpServer', x=-169.91, y=36.13, z=137.44], EntitySkeleton['Skeleton'/219, l='MpServer', x=-161.53, y=76.00, z=143.69], EntityChicken['Chicken'/220, l='MpServer', x=-174.50, y=92.00, z=134.50], EntitySquid['Squid'/221, l='MpServer', x=-167.53, y=59.00, z=164.53], EntitySquid['Squid'/222, l='MpServer', x=-169.50, y=61.03, z=163.53], EntitySpider['Spider'/223, l='MpServer', x=-167.28, y=49.00, z=178.50], EntityBat['Bat'/224, l='MpServer', x=-162.69, y=51.10, z=184.75], EntitySheep['Sheep'/225, l='MpServer', x=-171.47, y=66.00, z=187.16], EntityPig['Pig'/226, l='MpServer', x=-168.50, y=65.00, z=194.00], EntityCreeper['Creeper'/238, l='MpServer', x=-151.47, y=78.00, z=140.06], EntityZombie['Zombie'/239, l='MpServer', x=-155.47, y=94.00, z=142.84], EntityCow['Cow'/240, l='MpServer', x=-149.13, y=64.00, z=155.50], EntityZombie['Zombie'/241, l='MpServer', x=-147.25, y=89.00, z=145.50], EntitySquid['Squid'/242, l='MpServer', x=-152.66, y=59.00, z=164.50], EntityCow['Cow'/243, l='MpServer', x=-144.32, y=74.00, z=166.50], EntityItem['item.item.herbivoredung'/244, l='MpServer', x=-146.81, y=74.13, z=170.81], EntityItem['item.item.herbivoredung'/245, l='MpServer', x=-146.56, y=64.13, z=175.84], EntityPig['Pig'/246, l='MpServer', x=-148.19, y=67.00, z=171.03], EntityBat['Bat'/247, l='MpServer', x=-159.25, y=52.10, z=189.53], EntityItem['item.item.batguano'/248, l='MpServer', x=-145.63, y=50.13, z=178.13], EntitySkeleton['Skeleton'/249, l='MpServer', x=-146.72, y=50.00, z=185.25], EntitySpider['Spider'/250, l='MpServer', x=-149.34, y=50.77, z=180.28], EntityItem['item.tile.dirt.default'/251, l='MpServer', x=-151.13, y=62.13, z=181.38], EntityItem['item.tile.dirt.default'/252, l='MpServer', x=-150.72, y=62.13, z=186.59], EntityItem['item.tile.dirt.default'/253, l='MpServer', x=-154.88, y=62.13, z=182.13], EntityItem['item.tile.dirt.default'/254, l='MpServer', x=-150.53, y=61.13, z=181.13], EntityItem['item.item.bone'/255, l='MpServer', x=-150.81, y=61.13, z=181.38]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2566)
at net.minecraft.client.Minecraft.run(Minecraft.java:984)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_60, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 620512608 bytes (591 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1448 4 mods loaded, 4 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)
UCHIJAAAA Forge{10.13.4.1448} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1448-1.7.10.jar)
UCHIJAAAA rapadmod{1.0.0} [Realistic Animal Products and Drops Mod] (bin)
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 358.91' Renderer: 'GeForce GT 750M/PCIe/SSE2'
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: GeForce GT 750M/PCIe/SSE2 GL version 4.5.0 NVIDIA 358.91, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
[12:28:48] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\joshl\Downloads\forge-1.7.10-10.13.4.1448-1.7.10-src\eclipse\.\crash-reports\crash-2015-11-17_12.28.48-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
java.lang.NullPointerException: Rendering entity in world
at net.minecraft.client.renderer.entity.RenderSnowball.doRender(RenderSnowball.java:43)
Did you look at line 43 of RenderSnowball? It's trying to call a method on field_94151_a (the Item), which must be null. This means you created the RenderSnowball instance before you assigned a value to ModItems.blindsplash.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Did you look at line 43 of RenderSnowball? It's trying to call a method on field_94151_a (the Item), which must be null. This means you created the RenderSnowball instance before you assigned a value to ModItems.blindsplash.
So I would need to move my registerRenderThings method lower in the init method of my main mod file? I'll try that.
proxy.registerRenderThings needs to be called after ModItems.blindsplash is assigned a value (because it uses the value of that field), which presumably happens in ModItems.init.
You should be registering items, blocks and entities in preInit and renderers in init.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
proxy.registerRenderThings needs to be called after ModItems.blindsplash is assigned a value (because it uses the value of that field), which presumably happens in ModItems.init.
You should be registering items, blocks and entities in preInit and renderers in init.
Ok, I have my eventhandlers in init, those don't move, right? Just making sure.
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
Ok, I have my eventhandlers in init, those don't move, right? Just making sure.
It doesn't matter too much which phase events are registered in, since they're usually only fired after the loading process is complete.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Okay, I have my entity and it can be thrown without errors, though it still does not render. Any idea why?
Is is actually being spawned? Is it completely invisible, or does it display as the missing texture?
Are there any errors in the log?
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Is is actually being spawned? Is it completely invisible, or does it display as the missing texture?
Are there any errors in the log?
It is completely invisible. The only thing in the log is a bunch of Player right click: 1xitem.blindsplash@0 - RIGHT_CLICK_BLOCK - false and Player right click: 1xitem.blindsplash@0 - RIGHT_CLICK_AIR - false.
Rollback Post to RevisionRollBack
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
Did you give your potion item an icon? RenderSnowball renders the icon returned by Item#getIconFromDamage, if it's null it doesn't render anything.
I'd suggest putting a breakpoint in RenderSnowball#doRender and seeing what happens when you throw your potion.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Did you give your potion item an icon? RenderSnowball renders the icon returned by Item#getIconFromDamage, if it's null it doesn't render anything.
I'd suggest putting a breakpoint in RenderSnowball#doRender and seeing what happens when you throw your potion.
Ok, just had to give it an IconString. Now it renders. Just need to give it the AuxSFX and apply the potion effect to the entity hit and it should work perfectly.
Edit: AuxSFX works. Is there a method for applying a potion effect upon impact? I've tried this:
That should work, but what are you expecting to happen? If the blindness potion is unimplemented, then it probably won't have any effect when applied to an entity; even if it was implemented, I doubt it would really affect non-player entities in a noticeable manner.
Why don't you try applying regeneration or some other more visible effect just to test that your code is working as expected? Then you can change it back to blindness and decide from there how you want that to work.
That should work, but what are you expecting to happen? If the blindness potion is unimplemented, then it probably won't have any effect when applied to an entity; even if it was implemented, I doubt it would really affect non-player entities in a noticeable manner.
Why don't you try applying regeneration or some other more visible effect just to test that your code is working as expected? Then you can change it back to blindness and decide from there how you want that to work.
I understand that the potion of blindness was never implemented and as such does not have an ID, but I wanted to add a crafting recipe for it in a mod I'm working on. Is there any way of making this work?
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
My experience there is limited, but as a workaround I would make a custom item, maybe called ItemPotionBlindess. Then I would do whatever code vanilla Potions use for textures and use the onEaten() method to give the character the blindness potion effect. Then, of course, set up the crafting recipe for your custom Item.
If it's also able to be thrown (splash potion), jabelar has a tutorial for an item that activates on being thrown. I have not looked at the splash potion code, but that might also help.
Good luck!
Ok, I'm making it a custom throwable item that when impacting an entity, plays the glass breaking noise and gives them the blindness effect for 30 seconds.
In other words, it only acts like a splash potion.
Ok, I can throw the potion, but the thrown potion entity does not render. Also, how can I get it to apply a potion effect to an entity hit by it?
ClientProxy:
EntityBlindSplash.java:
ItemBlindSplash.java:
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
You can specify custom potion effects for the vanilla potion item using NBT. Set the CustomPotionEffects tag to a list of compound tags that each contain the data of a single PotionEffect. Use PotionEffect#writeCustomPotionEffectToNBT to write a PotionEffect to a compound tag in the appropriate format.
A potion is a splash potion if bit 14 of the metadata is 1 (you can use 1 << 14 as the metadata if you're using NBT for the effects). If you don't want a splash potion, set bit 13 to 1 instead (potions only display their name and effects if the metadata isn't 0, but custom effects will still work regardless of the metadata). The wiki explains potion metadata in more detail.
Look at EntityPotion to see how splash potions apply their effects to entities.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
My code is in my previous post, the item appears in-game, and I can equip it. However, when I throw it, it doesn't render (instead causing a crash related to RenderSnowball).
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
If it's crashing, post the crash report.
I'd still suggest looking at EntityPotion, it should show you exactly how to apply effects to nearby entities when it hits something.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
My crash report is below. I'm not making it strictly the same way potions are coded, as that system is a bit too complicated for my level of coding expertise. It's simply going to be a throwable item that inflicts the potion effect on impact.
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Did you look at line 43 of RenderSnowball? It's trying to call a method on field_94151_a (the Item), which must be null. This means you created the RenderSnowball instance before you assigned a value to ModItems.blindsplash.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
So I would need to move my registerRenderThings method lower in the init method of my main mod file? I'll try that.
Edit: Nvm, it kills the internal server.
The init method in my main mod file:
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
proxy.registerRenderThings needs to be called after ModItems.blindsplash is assigned a value (because it uses the value of that field), which presumably happens in ModItems.init.
You should be registering items, blocks and entities in preInit and renderers in init.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok, I have my eventhandlers in init, those don't move, right? Just making sure.
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
It doesn't matter too much which phase events are registered in, since they're usually only fired after the loading process is complete.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Okay, I have my entity and it can be thrown without errors, though it still does not render. Any idea why?
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Is is actually being spawned? Is it completely invisible, or does it display as the missing texture?
Are there any errors in the log?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
It is completely invisible. The only thing in the log is a bunch of Player right click: 1xitem.blindsplash@0 - RIGHT_CLICK_BLOCK - false and Player right click: 1xitem.blindsplash@0 - RIGHT_CLICK_AIR - false.
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Did you give your potion item an icon? RenderSnowball renders the icon returned by Item#getIconFromDamage, if it's null it doesn't render anything.
I'd suggest putting a breakpoint in RenderSnowball#doRender and seeing what happens when you throw your potion.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok, just had to give it an IconString. Now it renders. Just need to give it the AuxSFX and apply the potion effect to the entity hit and it should work perfectly.
Edit: AuxSFX works. Is there a method for applying a potion effect upon impact? I've tried this:
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
That should work, but what are you expecting to happen? If the blindness potion is unimplemented, then it probably won't have any effect when applied to an entity; even if it was implemented, I doubt it would really affect non-player entities in a noticeable manner.
Why don't you try applying regeneration or some other more visible effect just to test that your code is working as expected? Then you can change it back to blindness and decide from there how you want that to work.
That should work, but what are you expecting to happen? If the blindness potion is unimplemented, then it probably won't have any effect when applied to an entity; even if it was implemented, I doubt it would really affect non-player entities in a noticeable manner.
Why don't you try applying regeneration or some other more visible effect just to test that your code is working as expected? Then you can change it back to blindness and decide from there how you want that to work.
Don't dispenser shoot potion? If they do then you can use it to test it on yourself
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms