Suggested [Scenario] New Event: On Block Placed

KonstantinosD

New Member
Hello all!

The past few days I have been trying to add a new Event to the Scenario module and specifically one that triggers when the player places a block into the World. But I have faced a problem as it seems that the event fails to invoke when called from the HubTool.
I believe that one of the two following problems is causing this:
  • I have missed writting something that connects to the ConvertEntitySystem.java
  • The event OnBlockItemPlaced.java in org.terasology.world.block.items does not correspond to the event I'm trying to call
Here is a link to the github page https://github.com/Terasology/Scenario/pull/41

I'm waiting for any ideas/help any of you can provide :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Heya. Sorry for the delay I've been caught up in some stuff lately.

Could you give exact steps to replicate please? Grab that PR, run the game with Scenario enabled, open hub tool, then ... ?

One common bit of confusion is that there is both OnBlockItemPlaced and some similar events for plain blocks. There is a subtle difference between block items (like a torch you can place as a block) and simple blocks (a dirt block). That might relate

Thanks for the nice PR btw, it helps a lot to have some code to look at! One code style issue I can see in it is that your IDE is auto-collapsing to star imports, that's something we avoid, you can disable it in IntelliJ by increasing the number of imports to like 99 before collapsing to wildcard import.
 

KonstantinosD

New Member
It's okey we all have things to do!!

Oh I'm sorry for not being specific. After enabling Scenario, get hubtool, create event, scroll down and you will find my new option, On Block Placed. Select that and then try to just place down a block. Thats what I was trying to achieve but the event will not invoke. Your IDE will probably inform you of what went wrong...

Could you tell me what the system Event for Plain blocks placement is?? Cause I can't seem to find it!

About the auto collapsing, I realised it when I reviewed my code but I didn't think it was a problem. I will fix it on my next PR :)
 
Top