MultiMote
-
Posts
257 -
Joined
-
Last visited
Posts posted by MultiMote
-
-
You should create your own primed tnt entity and replace time there. And replace vanilla entity with your entity in EntityJoinWorldEvent.
-
I'm using MouseEvent and packets.
-
*wavefront
Model must have triangle faces.
Blender: up42.ru/u/p/___________________2014-08-15_17_41_06.png
-
world.func_147480_a(x, y, z, true);
-
-
entity.addVelocity ?
-
Try entity.moveEntity
params are motions
-
-
-
I tested it and it works. Recheck your code.
-
You can return null container for server, but you can't return null gui for client.
-
getPosition is clientside.
.posX can't cause NoSuchMethodError
-
public Item stack;
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player){
Random rand = new Random(); //itemRand
for(int m = 0; m < 6; m++) //you said 5
{
int r = rand.nextInt(Lootcube.pokelist.length - 1); //nextInt counts from 0
stack = Lootcube.pokelist[r];
player.inventory.addItemStackToInventory(new ItemStack(stack));
player.inventory.consumeInventoryItem(this);
itemStack.stackSize--;
}
return new ItemStack(stack); //why?
return itemStack;
}
public static Item[] pokelist = {Items.apple, Items.carrot, Items.potato, Items.slime_ball, Items.arrow, Items.beef, Items.shears};
@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player){
if(world.isRemote)return itemStack; //because ghost items
List<Item> tempList = new ArrayList<Item>();
tempList.addAll(Arrays.asList(pokelist)); //because remove() causes UnsupportedOperationException
for(int m = 0; m < 5; m++)
{
player.inventory.addItemStackToInventory(new ItemStack(tempList.remove(itemRand.nextInt(tempList.size())))); //because science
itemStack.stackSize--;
}
return itemStack;
}
-
Store Item links (Mymod.someitem etc.) in your array. NOT ItemStacks. Create new ItemStacks from items in your loop.
-
Use two blocks. Like door.
-
If chest is custom - sure.
-
This function is not intended for this case.
-
abs is module of the number.
abs(-10) -> 10
abs(10) -> 10
-
public static int getWorldMinutes(World world) { int time = (int) Math.abs((world.getWorldTime() + 6000) % 24000); return (time % 1000) * 6 / 100; } public static int getWorldHours(World world) { int time = (int)Math.abs((world.getWorldTime()+ 6000) % 24000); return (int)((float)time / 1000F); }
-
@Override public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { ItemStack next = player.inventory.currentItem+1 < player.inventory.getSizeInventory() ? player.inventory.getStackInSlot(player.inventory.currentItem+1) : null; if(side!=1 || !(next!=null && next.getItem() instanceof IPlantable))return false; int radius = 3; for(int x2 = -radius; x2<=radius; x2++) for(int z2 = -radius; z2<=radius; z2++){ if(next.stackSize>0)next.getItem().onItemUse(next, player, world, x+x2, y, z+z2, side, hitX, hitY, hitZ); if(next.stackSize<=0)player.inventory.setInventorySlotContents(player.inventory.currentItem+1, null); } return true; }
I think it works.
-
@Override public boolean onItemUse(ItemStack is, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if(side!=1 || world.getBlock(x, y, z) != Blocks.farmland)return false; if(world.isRemote)return true; int radius = 3; for(int x2 = -radius; x2<=radius; x2++) for(int z2 = -radius; z2<=radius; z2++) if(player.canPlayerEdit(x+x2, y, z+z2, side, is) && world.getBlock(x+x2, y+1, z+z2).getMaterial().isReplaceable() && world.getBlock(x+x2, y, z+z2) == Blocks.farmland) world.setBlock(x+x2, y+1, z+z2, Blocks.wheat, 0, 3); return true; }
-
Use par3 which is not 0.
-
Sources can be located at /build/tmp/recompSrc.
Or you can browse forge-1.7.10-*.jar lib in your IDE.
In IDEA you can press Ctrl+N and enter EntityTNTPrimed.
-
world.createExplosion(exploderEntity, x, y, z, radius, spawnParticles);
[1.7.2] Get ResourceLocation of Items
in Modder Support
Posted
TextureMap.locationItemsTexture