Help with coding

Status
This thread has been locked.
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
Why shall we help?
 

Macrolect

I'm Batman.
Premium
Feedback score
7
Posts
476
Reactions
196
Resources
0

BeastCraft3

Developer
Premium
Feedback score
1
Posts
70
Reactions
24
Resources
0
Sorry, I might not have understood that correctly.
If you want a player to stop being damaged after x amount of time caused by lava then use the event:
"EntityDamageEvent" and to check the cause of damage use: "DamageCause.LAVA"
 

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
i think he mean't when lava get spawned him, it gets removed after x amount of time
 

sores

MineBOI
Premium
Feedback score
5
Posts
305
Reactions
210
Resources
0
You could use a block place listener then, check if the block being placed is Lava, then just create a runnable to remove it after a certain amount of time.
 

LordOfTime

Feedback score
15
Posts
603
Reactions
245
Resources
0
If you could make the original post more clear, that would be appreciated. I'm not quite sure what you mean, and there are several ways to interpret it.
 

LordOfTime

Feedback score
15
Posts
603
Reactions
245
Resources
0

LordOfTime

Feedback score
15
Posts
603
Reactions
245
Resources
0
op ofc or would have quoted you :p

Aight, just was posted shortly after my message, and I wanted to make sure you weren't accusing me of being unhelpful by not attempting to give a response to an interpretation of the OP's request :p
 

sores

MineBOI
Premium
Feedback score
5
Posts
305
Reactions
210
Resources
0
If you could make the original post more clear, that would be appreciated. I'm not quite sure what you mean, and there are several ways to interpret it.
Pretty sure he wants lava to be cleared after a certain amount of time after being placed.
 

LordOfTime

Feedback score
15
Posts
603
Reactions
245
Resources
0
Pretty sure he wants lava to be cleared after a certain amount of time after being placed.

Let's be honest here; If that is the correct interpretation, he needs to learn to develop better before he attempts this. If you're not able to figure out how to use an event, with the multitude of resources available here, then you have bigger issues. Now, I'm not saying this to dis the OP. For all I know, they're a non-native English speaker and just can't read most of the documentation. All I'm saying is that there's basically only one way to answer that question, and it borders on spoonfeeding.
 

ValentinPlayer

Feedback score
0
Posts
13
Reactions
2
Resources
0
What I wanted to explain you is that i want to know is how to do that a bucket of lava removes after certain time

Sorry for my english and explanation, I speak spanish.[DOUBLEPOST=1492040117][/DOUBLEPOST]@EventHandler
public void bucket(PlayerBucketEmptyEvent e){

Material bucket = e.getBucket();
if(bucket.toString().equals("LAVA")){
Bukkit.getScheduler().scheduleSyncDelayedTask(main.instance, new Runnable(){

public void run()
{
//HERE I WANT TO REMOVE THE BUCKET (i think that this is not the event that i have to use)
}
}, 100L);
}
}
 
Last edited:

BeastCraft3

Developer
Premium
Feedback score
1
Posts
70
Reactions
24
Resources
0
What I wanted to explain you is that i want to know is how to do that a bucket of lava removes after certain time

Sorry for my english and explanation, I speak spanish.[DOUBLEPOST=1492040117][/DOUBLEPOST]@EventHandler
public void bucket(PlayerBucketEmptyEvent e){

Material bucket = e.getBucket();
if(bucket.toString().equals("LAVA")){
Bukkit.getScheduler().scheduleSyncDelayedTask(main.instance, new Runnable(){

public void run()
{
//HERE I WANT TO REMOVE THE BUCKET (i think that this is not the event that i have to use)
}
}, 100L);
}
}

I think it would be more efficent to just use BlockPlaceEvent, check if the placed material is equal to lava, start runnable then cancel the event.

if you dont understand that, then you should look up some tutorials :p
 

ValentinPlayer

Feedback score
0
Posts
13
Reactions
2
Resources
0
BlockPlaceEvent doesn´t work for buckets[DOUBLEPOST=1492045378][/DOUBLEPOST]Finally I succeeded it (I think that is not efficent):

@EventHandler
public void bucket(PlayerBucketEmptyEvent e){
World w = e.getPlayer().getWorld();
int x = e.getBlockClicked().getX();
int y = e.getBlockClicked().getY();
int aux = y+1;
int z = e.getBlockClicked().getZ();
Player p = e.getPlayer();

Bukkit.getScheduler().scheduleSyncDelayedTask(main.instance, new Runnable(){

public void run()
{
w.getBlockAt(x,aux,z).setTypeId(0);;
}
}, 100L);
}
 
Last edited:
Status
This thread has been locked.
Top