Everything posted by Maciej916
-
[1.15] Tickable world capability
Hello is it possible to make tickable world capability? When i implements ITickable it's working fine untill its run on client, when i run it on server it crash.
-
[1.15.1] Get fluid texture from FluidStack
I understand your point, but is it possible to get default blockstate and get a texture out of that ?
-
[1.15.1] Get fluid texture from FluidStack
Hell I want to draw in my gui fluid texture e.g water, lava but Im having troubles of getting ResourceLocation of teqture from FluidStack
-
[1.15.1] GUI Background multiple textures
Thank you, that was easier than i expected. ?
-
[1.15.1] GUI Background multiple textures
How I can use multiple texture locations while drawing gui elements. I know how to use only one texture. Please be tolerant Im trying to learn something new. @Override protected void drawGuiContainerBackgroundLayer(final float partialTicks, final int mouseX, final int mouseY) { RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); getMinecraft().getTextureManager().bindTexture(BACKGROUND_TEXTURE); int startX = this.guiLeft; int startY = this.guiTop; this.blit(startX, startY, 0, 0, this.xSize, this.ySize); this.blit(x, y, u, v, width, height); // How can i draw another element here using other texture than "BACKGROUND_TEXTURE" }
-
[1.15.1] Get fluid from bucket
Thank you, that's what i looked for
-
[1.15.1] Get fluid from bucket
Hello how can I get Fluid from Bucket ItemStack e.g LAVA from Lava Bucket, WATER from Water Bucket ect.
-
[Solved] [1.14.4] Client side packet
Sorry that was my mistake i didn't realize that i have other method in that class using Minecraft instance. Now everything works correctly, thank you!
-
[Solved] [1.14.4] Client side packet
I tried to use DistExecutor but error remain the same: public void handle(Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> { PlayerEntity player = Minecraft.getInstance().player; IEnchants enchantsCap = PlayerUtil.getEnchantsCapability(player); enchantsCap.setMultiJump(multiJump); }); }); ctx.get().setPacketHandled(true); }
-
[Solved] [1.14.4] Client side packet
Hello I want to sent packet from server to client and everything is working in single player but mod don't want to start on dedicated server because in packet I use Minecraft class. How can I fix this, can I use @OnlyIn() public class PacketMultiJumpSync { private final int multiJump; public PacketMultiJumpSync(int multiJump) { this.multiJump = multiJump; } public PacketMultiJumpSync(PacketBuffer buf) { multiJump = buf.readInt(); } public void toBytes(PacketBuffer buf) { buf.writeInt(multiJump); } public void handle(Supplier<NetworkEvent.Context> ctx) { ctx.get().enqueueWork(() -> { PlayerEntity player = Minecraft.getInstance().player; IEnchants enchantsCap = PlayerUtil.getEnchantsCapability(player); enchantsCap.setMultiJump(multiJump); }); ctx.get().setPacketHandled(true); } } INSTANCE.registerMessage(nextID(), PacketMultiJumpSync.class, PacketMultiJumpSync::toBytes, PacketMultiJumpSync::new, PacketMultiJumpSync::handle);
-
[1.14.4] HarvestDropsEvent is never called?
Thank you
-
[1.14.4] HarvestDropsEvent is never called?
I want to change amount of item drops and i want to do that by using BlockEvent.HarvestDropsEvent but it seems like it's never called and idk why. It's weird because i have other BlockEvents in this class and they work just fine. My forge version is 28.1.90 @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onHarvest(BlockEvent.HarvestDropsEvent event) { // not working } @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onPlace(BlockEvent.EntityPlaceEvent event) { // working } @SubscribeEvent public static void onBreak(BlockEvent.BreakEvent event) { // working }
-
[1.14.4] Detect keypress only once
I'll check that but for now i managed to fix this by using capability and set it to true/false when space is pressed.
-
[1.14.4] Detect keypress only once
Im making something like double jump and the thing is that it conflict with jumping when player holds space it fire multiple times. So I wanted to make it so player need to press space again to fire multi jump.
-
[1.14.4] Detect keypress only once
I already found that mc.gameSettings.keyBindJump there is a method isPressed() that should fire only once. But the porblem is how to handle this, because when i use event KeyInputEvent i get true every tick.
-
[1.14.4] Detect keypress only once
Where i can find any useful information how to do that? (I want to use already existing key for jump)
-
[1.14.4] Detect keypress only once
Hello I want to detect key press only once but when i use InputEvent.KeyInputEvents it detect press and hold. How can I detect keypress only once? @SubscribeEvent public static void clientKeyInput(InputEvent.KeyInputEvent event) { }
-
[1.14.4] How to add new enchant to my creative tab
Im having troubles to get list of all enchanted books items
-
[1.14.4] How to add new enchant to my creative tab
So i have Items.ENCHANTED_BOOK and what's next?
-
[1.14.4] How to add new enchant to my creative tab
So i try final Item.Properties properties = new Item.Properties().group(MOD_ITEM_GROUP); final EnchantedBookItem book = new EnchantedBookItem(properties); // register but it's still don't work
-
[1.14.4] How to add new enchant to my creative tab
Hello I want to add new enchant from my mod to my mod creative tab but i don't know how to do that. for (final Enchantment enchantment : ForgeRegistries.ENCHANTMENTS.getValues()) { final ResourceLocation enchantmentRegistryName = enchantment.getRegistryName(); if (!enchantmentRegistryName.getNamespace().equals(MyMod.MODID)) { continue; } final Item.Properties properties = new Item.Properties().group(MOD_ITEM_GROUP); // how to set ItemGroup }
-
[1.14.4] Player teleport event
Hello, Is there an event what fire when user got teleported or if there is a way to detect player teleport.
-
[1.14.4] How to kick player from server
Thank you, that's what i needed.
-
[1.14.4] How to kick player from server
Hello I want to kick player from server but i can't find method to do that.
-
[1.14.4] Teleporting player from the end (FIXED)
Hello, Im having trouble to teleport player from the end to overworld. For example if player teleport from end to nether it or from nether to overworld it works just fine but if player wants to teleport from end to overworld it always teleport him to spawn location not coordinates i want to. Here is code what i use: public static void teleportPlayer(ServerPlayerEntity player, Location loc, boolean exact) { if (player.dimension.getId() != loc.dim) { player.changeDimension(DimensionType.getById(loc.dim)); } ServerWorld world = player.getServerWorld(); if (exact) { player.teleport(world, loc.posX, loc.posY, loc.posZ, loc.rotationYaw, loc.rotationPitch); } else { player.teleport(world, loc.x + 0.5, loc.y + 0.5, loc.z, player.rotationYaw, player.rotationPitch); } }
IPS spam blocked by CleanTalk.