#there
1 messages · Page 1 of 1 (latest)
So @woven mantle. I've actually created something like that before, there is no way you can check the block when it's landed.
You can debug the EntityChangeBlockEvent, when it's landed it's not a falling block anymore.
isOnGround? I remember debugging it before and it returned once it landed but for some reason i can't get back to that point
Might just use a different way off spawning falling block
I kinda forgot how I did that xd.
From my understanding, once FallingBlock lands, it doesn't become an Entity anymore.
It's actually become a Block ig.
Yeahh I think i may have figured it out
Let me know how you did that xd.
then what though?
i added it to a arraylist
to check for it not pdc, can use pdc though
When it landed, replace it with chest containing the items you want.
Check for the pdc.
how do i replace it though
You can set a block in a location.
so i need to set this entity to air? then spawn a block at its location
What does blockstate do?
I'm making it so you right or left click it, it then turns to air and items pop out so just need to change it to a chest, testing it now
how do i use block data so i can refer back to this chest that lands as i need to check for it in an event
Ah yes, you can put pdc into a block with this lib, check it out. https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/
Okay cool one more question, in the params it asks for block, how do i call this specific block? i'm using event.getblock.settype(Material.Chest)
What do you mean?
It's asking for a block as the first args
It's event.getBlock.
ahh so now that variable is set to this current block that's been set in this event
so every time it's called thats the way to check for it
So basically, when the block landed, set chest at location and put pdc on the block, and then you listen to PlayerInteractEvent, check for the pdc. If the pdc is valid, set the block to AIR and drop the items.
yeah sound, so i do it like a normal pdc check?
Yes, correct.
Still doesn't change when it lands :/
Keep the debug, to see If it's still working.
Yeah, you need to shade the libs.
How do you do that? i saw that but my maven got no config section?
Try to look up on spigot forums how to shade a libs.
kk
It's almost midnight on my time so I think I'm gonna be off soon.
Do you have other libs that you set as dependency?
Custom Block Data shouldn't add that much size.
Nope none
Give me your pom
You do have other libs.
You have lombok.
Also fix this configuration <shadedPattern>your.package.name.CustomBlockData</shadedPattern>
Okay, the file should be much smaller now.
also for the block landing, it sends broadcast but doesn't change
Maybe try event.getEntity().getLocation().getBlock().setType(Material.CHEST)