Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14] How do I make a placed block create a structure?


askod333
 Share

Recommended Posts

Hi everyone,

 

I am almost done with my mod that I only need for myself, I just can't grasp how to code one thing.

I need to code it so when a block is placed by a player, a structure appears instead of the block. I suppose I am meant to use the onBlockAdded method, but I can't understand, how it works. Could someone show me how to code it please? Also, how do I map the structure? Do i use XYZ coordinates?

 

Thank you for the response!

Link to comment
Share on other sites

It would be really helpful if you could give me an example of such code and I would change the values to match the structure. Again, this mod is for my purposes only, I will not upload it anywhere if you are afraid of you doing someone else's work.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • So I wants to try a new modpack. But when I create a new world(Single player), it keep crashing with "Exception in server tick loop". I have tried any possible solutions that I can found online, but it still the same. Here is my crash-report: Crash-Reports Here is my debug log: debug log  
    • crashes and shows this "The game crashed whilst rendering overlay Error: com.electronwill.nightconfig.core.io.WritingException: An I/O error occured Exit Code: 255" heres the crash report https://pastebin.com/NHGPeLjM
    • Hello, I am trying to run the Forge [1.15.5] edition, I keep getting the following: The game crashed whilst initializing game Error: java.lang.IllegalStateException: GLFW error before init:[0x10008]Cocoa: Failed to find service port for display Exit Code: 255   I'm not very good with these types of things, so any help would be greatly appreciated!
    • Well, tbh I do not understand what does it mean. Yeah, there is vanilla class MinecartItem and it is used to connect vanilla items to vanilla carts) All of these I've said in P.S. It's impossible to use MinecartItem in my situation, because it requires AbstractMinecart.Type as the first parameter. If I type e.g. AbstractMinecart.Type.FURNACE then item which was registered via MinecartItem will be connected to vanilla furnace_minecrat, not my custom cart. If I'm not right and you know the way to reach my goals using MinecartItem, could you please share this way?)
    • I have a crash as well.  No mods on the client or server.   Pre-existing world, just upgraded the server to spigot-1.18. ---- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 11/30/21, 7:43 PM Description: Unexpected error java.lang.NoSuchFieldError: factory     at net.minecraft.world.level.chunk.PalettedContainer$Configuration.equals(PalettedContainer.java:280) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.PalettedContainer.m_188051_(PalettedContainer.java:76) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.PalettedContainer.m_63118_(PalettedContainer.java:149) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.LevelChunkSection.m_63004_(LevelChunkSection.java:157) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.LevelChunk.m_187971_(LevelChunk.java:431) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.client.multiplayer.ClientChunkCache.m_194116_(ClientChunkCache.java:96) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.multiplayer.ClientPacketListener.m_194198_(ClientPacketListener.java:607) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.multiplayer.ClientPacketListener.m_183388_(ClientPacketListener.java:602) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket.m_5797_(ClientboundLevelChunkWithLightPacket.java:45) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket.m_5797_(ClientboundLevelChunkWithLightPacket.java:12) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:21) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:151) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:125) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:110) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1009) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:660) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.18-38.0.1.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at net.minecraft.world.level.chunk.PalettedContainer$Configuration.equals(PalettedContainer.java:280) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.PalettedContainer.m_188051_(PalettedContainer.java:76) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.PalettedContainer.m_63118_(PalettedContainer.java:149) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.LevelChunkSection.m_63004_(LevelChunkSection.java:157) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.world.level.chunk.LevelChunk.m_187971_(LevelChunk.java:431) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.client.multiplayer.ClientChunkCache.m_194116_(ClientChunkCache.java:96) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.multiplayer.ClientPacketListener.m_194198_(ClientPacketListener.java:607) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.multiplayer.ClientPacketListener.m_183388_(ClientPacketListener.java:602) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket.m_5797_(ClientboundLevelChunkWithLightPacket.java:45) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket.m_5797_(ClientboundLevelChunkWithLightPacket.java:12) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.network.protocol.PacketUtils.m_131356_(PacketUtils.java:21) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:151) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading}     at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:125) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B} -- Affected level -- Details:     All players: 1 total; [LocalPlayer['lennox15'/3231, l='ClientLevel', x=-52.32, y=70.00, z=-60.36]]     Chunk stats: 729, 0     Level dimension: minecraft:overworld     Level spawn location: World: (8,64,8), Section: (at 8,0,8 in 0,4,0; chunk contains blocks 0,-64,0 to 15,319,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,-64,0 to 511,319,511)     Level time: 0 game time, 0 day time     Server brand: Spigot     Server type: Non-integrated multiplayer server Stacktrace:     at net.minecraft.client.multiplayer.ClientLevel.m_6026_(ClientLevel.java:407) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91354_(Minecraft.java:2249) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:682) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18-20211130.085255-srg.jar%2352!:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:45) ~[fmlloader-1.18-38.0.1.jar%2322!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.0.7.jar%235!:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:90) [bootstraplauncher-0.1.17.jar:?] {} -- Last reload -- Details:     Reload number: 1     Reload reason: initial     Finished: Yes     Packs: Mod Resources, Default -- System Details -- Details:     Minecraft Version: 1.18     Minecraft Version ID: 1.18     Operating System: Windows 10 (amd64) version 10.0     Java Version: 17.0.1, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 467812952 bytes (446 MiB) / 1375731712 bytes (1312 MiB) up to 2147483648 bytes (2048 MiB)     CPUs: 8     Processor Vendor: GenuineIntel     Processor Name: Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz     Identifier: Intel64 Family 6 Model 142 Stepping 10     Microarchitecture: Coffee Lake     Frequency (GHz): 2.11     Number of physical packages: 1     Number of physical CPUs: 4     Number of logical CPUs: 8     Graphics card #0 name: DisplayLink USB Device     Graphics card #0 vendor: DisplayLink (0x17e9)     Graphics card #0 VRAM (MB): 0.00     Graphics card #0 deviceId: 0x4302     Graphics card #0 versionInfo: DriverVersion=9.3.3324.0     Graphics card #1 name: DisplayLink USB Device     Graphics card #1 vendor: DisplayLink (0x17e9)     Graphics card #1 VRAM (MB): 0.00     Graphics card #1 deviceId: 0x4302     Graphics card #1 versionInfo: DriverVersion=9.3.3324.0     Graphics card #2 name: Intel(R) UHD Graphics 620     Graphics card #2 vendor: Intel Corporation (0x8086)     Graphics card #2 VRAM (MB): 1024.00     Graphics card #2 deviceId: 0x5917     Graphics card #2 versionInfo: DriverVersion=27.20.100.9664     Memory slot #0 capacity (MB): 16384.00     Memory slot #0 clockSpeed (GHz): 2.40     Memory slot #0 type: DDR4     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 2.13     Memory slot #1 type: DDR4     Virtual memory max (MB): 28018.48     Virtual memory used (MB): 21184.61     Swap memory total (MB): 3584.00     Swap memory used (MB): 191.53     JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     Launched Version: 1.18-forge-38.0.1     Backend library: LWJGL version 3.2.2 SNAPSHOT     Backend API: Intel(R) UHD Graphics 620 GL version 3.2.0 - Build 27.20.100.9664, Intel     Window size: 854x480     GL Caps: Using framebuffer using OpenGL 3.2     GL debug messages:      Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     Graphics mode: fancy     Resource Packs: vanilla     Current Language: English (US)     CPU: 8x Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz     ModLauncher: 9.0.7+91+master.8569cdf     ModLauncher launch target: forgeclient     ModLauncher naming: srg     ModLauncher services:           mixin PLUGINSERVICE           eventbus PLUGINSERVICE           object_holder_definalize PLUGINSERVICE           runtime_enum_extender PLUGINSERVICE           capability_token_subclass PLUGINSERVICE           accesstransformer PLUGINSERVICE           runtimedistcleaner PLUGINSERVICE           mixin TRANSFORMATIONSERVICE           fml TRANSFORMATIONSERVICE      FML Language Providers:          minecraft@1.0         javafml@null     Mod List:          client-1.18-20211130.085255-srg.jar               |Minecraft                     |minecraft                     |1.18                |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         forge-1.18-38.0.1-universal.jar                   |Forge                         |forge                         |38.0.1              |DONE      |Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90     Crash Report UUID: 524d3bf5-8871-419a-9252-30ac9fddbaf4     FML: 38.0     Forge: net.minecraftforge:38.0.1
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.