-
Posts
1160 -
Joined
-
Days Won
7
Everything posted by poopoodice
-
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.
-
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.
-
I'm also interested in if the client side only commands works in newer versions, but unfortunately I can't test it now.
-
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)
-
(Solved) 1.14.4 - Filling container slots with items
poopoodice replied to starhan7's topic in Modder Support
try return an empty stack in slotClick() and for the "number" transfer -
Make a mob attack only specific players
poopoodice replied to BigWordsScareMe's topic in Modder Support
If you mean a custom mob, I think you will be able to use goals to decide and target the players with certain condition. -
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
-
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
-
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.
-
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?
-
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.
-
updating 1.10.2 to 1.12.2 textures and other stuff not working
poopoodice replied to MagicQuest's topic in Modder Support
a repo can be helpful -
just asking isn't itemgroup both sided?
-
I don't think it's actually glowing, it's just item texture animation make it looks like
-
1.15.2 How to make a class for several blocks
poopoodice replied to Tewott's topic in Modder Support
true, only 1.12- uses two blocks. -
1.15.2 How to make a class for several blocks
poopoodice replied to Tewott's topic in Modder Support
of course you can, and iirc there are only two slabs blocks (half with upper/lower) and a doubled. -
[1.15.2] Best way to store strings on the player object.
poopoodice replied to ZeProfCoding's topic in Modder Support
Capability is normally a better option, you can even store all those values in a single capability. -
Item and blocks' textures use .mcmeta, and it does not seem to work on armours. How do I do animated armour textures?
-
[1.15.2] Server not doing anything but no crash nor error
poopoodice replied to QuantumSoul's topic in Modder Support
have you accept the eula? (change false to true in eula.txt) -
Post your code
-
Maybe Client Chat Event... I'm not so sure.
-
You can't atm afaik.