Whompy
-
Posts
36 -
Joined
-
Last visited
Posts posted by Whompy
-
-
2 minutes ago, Draco18s said:
Look at how the chorus fruit handles cooldowns.
thx
-
I have an item that displays text in chat upon right click
How do I prevent an item like this from spamming in the chat by holding the right click button?
-
4 hours ago, diesieben07 said:
Because Forge cannot develop more than 2 versions at once. And because 1.12.2 is old now. That's how updates work.
Not updating 1.12.2 makes sense, however I do think that there should be a place to ask modding questions regarding old versions. This could be achieved via creating a new forum area call
Old Mod Version Development. In this area moderators could just ignore questions, and let people willing to work with older versions answer questions.
-
13 minutes ago, Draco18s said:
Banner at the top of every page:
Ok then ;-;
-
Why has the forums dropped 1.12.2 support?
Wouldn't it be better to create a section devoted to issues in "old versions" which moderators don't give help too?
Also when did it drop 1.12 support just curious
-
26 minutes ago, DavidM said:
1.12.2 is no longer supported on this forum.
Update to a modern version of Minecraft to receive support.
since when?
just curious
-
I am attempting to create a custom machine that takes in two items and a liquid and outputs another item how would I go about creating such a machine
-
Ok I figured it out on my own thanks for the help
-
8 hours ago, Ugdhar said:
Not doing so makes it harder to debug your issue, and a lot of people are "too lazy" to debug partial code.
ok fine, my question why do u need to see more of my code?
Is there more code relating to the right click function that I should take a look at?
-
1 hour ago, Draco18s said:
There's no reason to create a glass stack if you're just going to call getItem() on it.
entity.getItem().getItem() == Items.GLASS
So other than that, what is wrong with my code?
-
2 minutes ago, Draco18s said:
There's no reason to create a glass stack if you're just going to call getItem() on it.
entity.getItem().getItem() == Items.GLASS
Noted
-
On 12/29/2019 at 10:07 AM, loordgek said:
dont use getItemById
where does enableStats come from?
entity.getItem().getItem() == glass.getItem()
what is glass
can you post your code on github so we can see everything
I am too lazy to make a github, sorry for not responding earlier btw
Here's the variables I forgot to put in the thread
when I created the public Boolean, enablestats was what appeared in the autogenerated return statement. I honestly don't know what it does nor have I looked into it
ItemStack glass = new ItemStack(Blocks.GLASS); ItemStack Magic_orb = new ItemStack(ModItems.ORB_OF_CHANNELING); Item sponge = Item.getItemFromBlock(Blocks.SPONGE);
-
3 hours ago, Draco18s said:
This AABB only contains the full 1x1x1 volume that your block occupies. If you want the space above it you need to offset the Y by more than 1 unit (and you can offset the bottom by +1 to avoid needlessly checking the volume your block fills).
I am aware of this my block is about the size of a slab so it's fine
-
I have two blocks that I am trying to use to craft items from my mod. The first block when right clicked, is supposed to check for an item above it in this case a glass block, then check for a ball of magma cream and a modded item I made in the first two slots of the container. However, nothing is happening when the block is right clicked so I assume one of the if statements is faulty.
Here's my onblockactivated method (idk why indents are weird in eclipse they look fine):
@Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(!playerIn.isSneaking()) { if(worldIn.getBlockState(pos.down(1)) == ModBlocks.Magic_Sponge.getDefaultState()) { List<EntityItem> entities = worldIn.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1,pos.getY() + 1, pos.getZ()+1)); for (EntityItem entity : entities) { if(entity.getItem().getItem() == glass.getItem()) { TileEntityMagicSponge tileentity = (TileEntityMagicSponge)worldIn.getTileEntity(pos.down()); Item Magma_cream = tileentity.getStackInSlot(1).getItem(); Item Magic_Caytalist = tileentity.getStackInSlot(2).getItem(); ItemStack stack = entity.getItem(); if(Magma_cream == Items.MAGMA_CREAM.getItemById(378) && Magic_Caytalist == ModItems.CAYTALIST.getItemById(4110)) { if(!worldIn.isRemote) { while (stack.getCount() > 0) { EntityItem item = new EntityItem(worldIn, pos.getX()+0.5F, pos.getY(), pos.getZ()+0.5F, Magic_orb); worldIn.spawnEntity(item); stack.shrink(1); tileentity.removeStackFromSlot(0); tileentity.removeStackFromSlot(1); worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_FIREWORK_LAUNCH, entity.getSoundCategory(), 0.8F, 0.8F + entity.world.rand.nextFloat() * 0.4F); } } } } } } } return enableStats; } }
-
i would recommend watching modding tutorials and looking at popular mods' github's
Make sure never to copy and paste copyrighted code, but otherwise go nuts.
Learn basic java first if you want to get far.
-
Eyy It works thx people ❤️
-
List<EntityItem> entities = worldIn.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.getX(), pos.getY(), pos.getZ(), pos.getX(),pos.getY() + 1D, pos.getZ()));
I gave this a shot, however it didn't quite work. I assume the issue is with the letter D I put after the number 1. Am I right?
-
2 minutes ago, SerpentDagger said:
You're currently checking for entities at (0, 0, 0). You need to offset the box's position by the position of the block being clicked.
do you mean the coordinates 0,0,0 ?
-
So I put some code together to check if a glass block entityItem is on top of my block.
It doesn't quite work
what am I doing wrong?
ItemStack glass = new ItemStack(Blocks.GLASS); @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { if(!playerIn.isSneaking()) { if(worldIn.getBlockState(pos.down(1)) == ModBlocks.MAGIC_BLOCK.getDefaultState()) { List<EntityItem> entities = worldIn.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(0D, 0, 0D, 1D, 1D, 1D)); for (EntityItem entity : entities) { if(entity.getItem() == glass) { EntityItem item = new EntityItem(worldIn, pos.getX()+0.5F, pos.getY(), pos.getZ()+0.5F, glass); item.setNoPickupDelay(); entity.setFire(90000); worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), SoundEvents.ENTITY_FIREWORK_LAUNCH, entity.getSoundCategory(), 0.8F, 0.8F + entity.world.rand.nextFloat() * 0.4F); } } }else { } } return enableStats; } }
-
3 minutes ago, diesieben07 said:
Uh, no, you do not.
Then what is the point of Block Container?
-
2 minutes ago, diesieben07 said:
Uhm, extend Block instead?
I mean don't I need Block Container to create a block with an inventory?
-
2 minutes ago, diesieben07 said:
You're extending BlockContainer. BlockContainer is stupid. Don't use it.
what alternatives are there?
-
I have created a custom model for an ordinary block that functions perfectly, now I am trying to create a model for a Block that extends BlockContainer. As of now, everything works including the container itself and GUI. However, I was unable to apply a non-animated model to said block. What am I doing wrong?
Blockstates Json file:
{ "variants": { "normal": { "model": "magi:block_sponge" } } }
Model Json file:
{ "__comment": "Model generated using MrCrayfish's Model Creator (https://mrcrayfish.com/tools?id=mc)", "textures": { "anvil_top_damaged_0": "minecraft:blocks/anvil_top_damaged_0", "magic_essense_block": "magi:blocks/magic_essense_block" }, "display": { "gui": { "rotation": [ 30, 45, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 0.625, 0.625, 0.625 ] }, "ground": { "rotation": [ 0, 0, 0 ], "translation": [ 0, 3, 0 ], "scale": [ 0.25, 0.25, 0.25 ] }, "fixed": { "rotation": [ 0, 180, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] }, "head": { "rotation": [ 0, 180, 0 ], "translation": [ 0, 0, 0 ], "scale": [ 1, 1, 1 ] }, "firstperson_righthand": { "rotation": [ 0, 315, 0 ], "translation": [ 0, 2.5, 0 ], "scale": [ 0.4, 0.4, 0.4 ] }, "thirdperson_righthand": { "rotation": [ 75, 315, 0 ], "translation": [ 0, 2.5, 0 ], "scale": [ 0.375, 0.375, 0.375 ] } }, "elements": [ { "name": "Cube", "from": [ 1, 0, 0 ], "to": [ 15, 1, 1 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 2, 13, 3 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] } } }, { "name": "Cube", "from": [ 1, 0, 15 ], "to": [ 15, 1, 16 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] } } }, { "name": "Cube", "from": [ 0, 0, 1 ], "to": [ 1, 1, 15 ], "faces": { "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 1, 13, 0 ], "rotation": 90 }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 } } }, { "name": "Cube", "from": [ 15, 0, 1 ], "to": [ 16, 1, 15 ], "faces": { "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 } } }, { "name": "Cube", "from": [ 0, 0, 0 ], "to": [ 1, 16, 1 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 10, 5, 11, 6 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 9, 5, 10, 6 ] } } }, { "name": "Cube", "from": [ 0, 0, 15 ], "to": [ 1, 16, 16 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 10, 5, 11, 6 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 9, 5, 10, 6 ] } } }, { "name": "Cube", "from": [ 15, 0, 15 ], "to": [ 16, 16, 16 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 10, 5, 11, 6 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 9, 5, 10, 6 ] } } }, { "name": "Cube", "from": [ 15, 0, 0 ], "to": [ 16, 16, 1 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 15 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 4, 16 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 10, 5, 11, 6 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 9, 5, 10, 6 ] } } }, { "name": "Cube", "from": [ 1, 15, 0 ], "to": [ 15, 16, 1 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 2, 13, 3 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] } } }, { "name": "Cube", "from": [ 1, 15, 15 ], "to": [ 15, 16, 16 ], "faces": { "north": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 2, 13, 3 ] }, "south": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] } } }, { "name": "Cube", "from": [ 15, 15, 1 ], "to": [ 16, 16, 15 ], "faces": { "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 } } }, { "name": "Cube", "from": [ 0, 15, 1 ], "to": [ 1, 16, 15 ], "faces": { "east": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "west": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ] }, "up": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 }, "down": { "texture": "#anvil_top_damaged_0", "uv": [ 3, 0, 13, 1 ], "rotation": 90 } } }, { "name": "Cube", "from": [ 1, 1, 1 ], "to": [ 15, 15, 15 ], "faces": { "north": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] }, "east": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] }, "south": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] }, "west": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] }, "up": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] }, "down": { "texture": "#magic_essense_block", "uv": [ 1, 1, 15, 15 ] } } } ] }
-
1 minute ago, diesieben07 said:
Why on earth are you using Object here?
You can't do this. This will make the entire game wait for that amount of time.
idk I was trying to store entity specific information
Entity Collisions not working
in Modder Support
Posted
I have created an custom projectile that is when fired when right clicking a sword, however this projectile seems to not collide with anything (it passes through blocks and entities)
How do I fix this?