Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. use raytracing to find the location (player.getLookVec() to get where the player's looking at) of the block that is going to be placed and use world.setBlockState to set the block. BlockItem contains a lot of information you want.
  2. I think you should be able to simply return null in getStateForPlacement() (in custom block class), and you can get the information you want from there as well, otherwise you can also use EntityPlaceEvent that I don't think you will even need packets depend on what do you want to do.
  3. I'm also interested in if the client side only commands works in newer versions, but unfortunately I can't test it now.
  4. What I have: @SubscribeEvent public static void onRenderCrosshair(RenderGameOverlayEvent.Pre event) { if (event.getType() == RenderGameOverlayEvent.ElementType.CROSSHAIRS) { event.setCanceled(true); int screenHeight = event.getWindow().getScaledHeight(); int screenWidth = event.getWindow().getScaledWidth(); minecraft.getTextureManager().bindTexture(REC); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); bufferbuilder.pos(screenWidth / 2.0D - 1, screenHeight / 2.0D, -90.0D).tex(0.0F, 1.0F).endVertex(); bufferbuilder.pos(screenWidth / 2.0D - 1, screenHeight / - 5, -90.0D).tex(0.0F, 0.0F).endVertex(); bufferbuilder.pos(screenWidth / 2.0D + 30, screenHeight /, -90.0D).tex(1.0F, 1.0F).endVertex(); bufferbuilder.pos(screenWidth / 2.0D + 30, screenHeight / - 5, -90.0D).tex(1.0F, 0.0F).endVertex(); tessellator.draw(); } } What it shows: Any ideas? (the texture is a pure green 16x16 png file)
  5. try return an empty stack in slotClick() and for the "number" transfer
  6. If you mean a custom mob, I think you will be able to use goals to decide and target the players with certain condition.
  7. I tried InputEvent.MouseInputEvent and InputEvent.ClickInputEvent and InputEvent.RawMouseEvent they worked fine but they are unable to detect when the user is "holding/pressing" the button. Is it a good idea to check if the button (mouse) is down in client tick event? if so, how do I check it since the org.lwjgl.input.Mouse.isButtonDown(i) no longer exist and I can't find something similar. http://forum.lwjgl.org/index.php?topic=5857.0
  8. Ah, by that can't you not just use something like @Override public ItemStack getContainerItem(ItemStack itemStack) { ItemStack result = new ItemStack(something); result.setTag(itemStack.getTag()); return result; } ?
  9. I remember in vanilla minecraft you can combine two damaged items, which are saved by nbt as well, but I don't know how they work and where they are being done.
  10. I've never interact with container item before but I think you should be able to get the nbt tag from the old stack and attach it to the new stack?
  11. I remember that when you do your own loot tables you need to add name tag in front of the "rolls" { "type": "minecraft:block", "pools": [ { "name": "a name here", <----------- "rolls": 1, "entries": [ { "type": "minecraft:item", "name": "minecraft:apple" } ] } ] } if you want to have a try with that
  12. Oops, I meant to type BlockRayTraceResult blockResult for (int i=0;i<10;i++) { blockResult = //split into 10 sections, just an example world.rayTraceBlocks(new RayTraceContext(from.add((to.subtract(from)).mul(0.1D, 0.1D, 0.1D).mul(i, i, i)) , to, RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.ANY, this)); if (.......... ..... } but it's just an example, don't think it will work properly without any disadvantages such as cause lags,, etc.
  13. AxisAlignedBB axisalignedbb = this.getBoundingBox().expand(this.getMotion()).grow(1.0D); Vec3d from = this.getPositionVec(); Vec3d to = this.getPositionVec().add(new Vec3d(this.getMotion().getX(), this.getMotion().getY(), this.getMotion().getZ())); EntityRayTraceResult entityResult = ProjectileHelper.rayTraceEntities(world, this, from, to, axisalignedbb, (entity) entity -> != getThrower()); BlockRayTraceResult blockResult = world.rayTraceBlocks(new RayTraceContext(from, to, RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.ANY, this)); as shown above, both entity/block ray trace only gets the first block/entity hit. does doing multiple raytracing such as splitting one raytracing into multiple like BlockRayTraceResult blockResult for (int i=0;i<10;i++) { blockResult = //split into 10 sections, just an example world.rayTraceBlocks(new RayTraceContext(from, from + (to - from) / 10 * i, RayTraceContext.BlockMode.COLLIDER, RayTraceContext.FluidMode.ANY, this)); if (.......... ..... } sounds like a good idea, or it will cause bad performances?
  14. It has troubled me for a long time, I already made a bullet that can fire correctly, but what I want is that it reduces damages and its range when hit a block/entity instead of just got removed. And currently it extends ThrowableEntity. What I tried to do was to check in onImpact() if the bullet was hitting a block, if true reduces range and damage, but the problem is if the bullet hit both of them at the same time (which can be pretty big since it moves really fast), it only returns the first thing got hit and then it moves to the next position and ignores the other(s) hits. I also try to find every single block between the start vec and destination vec (entity hit), but it will be really terrible if there are lots of bullets in the world doing that at the same time.. any ideas will be appreciated.
  15. just asking isn't itemgroup both sided?
  16. I don't think it's actually glowing, it's just item texture animation make it looks like
  17. true, only 1.12- uses two blocks.
  18. of course you can, and iirc there are only two slabs blocks (half with upper/lower) and a doubled.
  19. Capability is normally a better option, you can even store all those values in a single capability.
  20. Item and blocks' textures use .mcmeta, and it does not seem to work on armours. How do I do animated armour textures?
  21. have you accept the eula? (change false to true in eula.txt)
  22. Post your code
  23. Maybe Client Chat Event... I'm not so sure.
  24. You can't atm afaik.
×
×
  • Create New...

Important Information

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