You are not logged in.

  • Login
Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

geoneo97

User / Kunde

  • "geoneo97" started this thread

Posts: 144

  • Send private message

1

Saturday, May 17th 2014, 6:49am

2 Fehler ? EntityDamageEvent und EntityChangeBlockEvent

Hi,hallo
Ich bekomme ständig diese 2 Errors in der Konsole
Sowas hatte ich noch nie -.-

Woran kann das liegen, Ich finde den fehler nicht


1Fehler

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[00:47:45] [Server thread/ERROR]: Could not pass event EntityDamageEvent to Time v0.6 
org.bukkit.event.EventException 
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:320) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:471) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEvent(CraftEventFactory.java:98) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEntityDamageEvent(CraftEventFactory.java:386) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.b(EntityLiving.java:857) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.Entity.a(Entity.java:792) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.a(EntityLiving.java:143) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.Entity.move(Entity.java:620) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1210) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1466) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityInsentient.e(EntityInsentient.java:306) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityAgeable.e(EntityAgeable.java:87) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityAnimal.e(SourceFile:37) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntitySheep.e(EntitySheep.java:49) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.h(EntityLiving.java:1299) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityInsentient.h(EntityInsentient.java:150) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.entityJoinedWorld(World.java:1348) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.playerJoinedWorld(World.java:1329) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.tickEntities(World.java:1217) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.WorldServer.tickEntities(WorldServer.java:480) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:637) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_7_R1.entity.CraftSheep cannot be cast to org.bukkit.entity.Player 
at time.geoneo.Events.onEntityDamageEvent(Events.java:238) ~[?:?] 
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) ~[?:?] 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_55] 
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_55] 
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:318) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
... 26 more


Ganz unten dort steht

entity.CraftSheep cannot be cast to org.bukkit.entity.Player

da steht auch, entity.enderman , entity.creeper etc.

Ich vermute, das liegt EntityDeathEvent.

Source code

1
2
3
4
5
@EventHandlerpublic void onmob(EntityDeathEvent e) { 
Player k= e.getEntity().getKiller();if( k instanceof Player){ 
k.giveExpLevels(5); 
} 
}


aber wo ist dort der fehler !? habe doch instanceof Player und nicht auf mob !?

2Fehler

KONSOLE:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[00:54:35] [Server thread/ERROR]: Could not pass event EntityChangeBlockEvent to Time v0.6 
org.bukkit.event.EventException 
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:320) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:471) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEntityChangeBlockEvent(CraftEventFactory.java:536) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callEntityChangeBlockEvent(CraftEventFactory.java:519) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.PathfinderGoalEatTile.e(PathfinderGoalEatTile.java:66) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.PathfinderGoalSelector.a(PathfinderGoalSelector.java:108) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityInsentient.bn(EntityInsentient.java:427) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntitySheep.bn(EntitySheep.java:41) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1436) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityInsentient.e(EntityInsentient.java:306) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityAgeable.e(EntityAgeable.java:87) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityAnimal.e(SourceFile:37) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntitySheep.e(EntitySheep.java:49) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityLiving.h(EntityLiving.java:1299) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.EntityInsentient.h(EntityInsentient.java:150) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.entityJoinedWorld(World.java:1348) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.playerJoinedWorld(World.java:1329) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.World.tickEntities(World.java:1217) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.WorldServer.tickEntities(WorldServer.java:480) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:637) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_7_R1.entity.CraftSheep cannot be cast to org.bukkit.entity.FallingBlock 
at time.geoneo.Events.onBlockFall(Events.java:256) ~[?:?] 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_55] 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_55] 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_55] 
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_55] 
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:318) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks] 
... 25 more



CODE

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@EventHandlerpublic void onBlockFall(EntityChangeBlockEvent event) { 
final FallingBlock fb = (FallingBlock) event.getEntity();if ((event.getEntityType() == EntityType.FALLING_BLOCK)) { 
FallingBlock block = (FallingBlock)event.getEntity();if( fb.getBlockId() == 138) {Firework firework = fb.getWorld().spawn(fb.getLocation().add(0, -1, 0), Firework.class); 
FireworkEffect effect = FireworkEffect.builder().withColor(Color.AQUA) 

.flicker(true).trail(true) 
.withFade(Color.BLUE).withFade(Color.ORANGE) 
.with(FireworkEffect.Type.BALL_LARGE).with(FireworkEffect.Type.BALL) 
.with(FireworkEffect.Type.STAR).with(FireworkEffect.Type.BURST) 
.build(); 
FireworkMeta meta = firework.getFireworkMeta(); 
meta.addEffect(effect); 
firework.setFireworkMeta(meta); 
} 

} 

}


Hier genau das selbe

CraftSheep cannot be cast to org.bukkit.entity.FallingBlock

mfg

This post has been edited 3 times, last edit by "geoneo97" (May 17th 2014, 6:56am) with the following reason: Richtig Formatiert


BtoBastian

Moderator

  • "BtoBastian" is male

Posts: 3,612

Occupation: Softwareentwickler

  • Send private message

2

Saturday, May 17th 2014, 8:10am

Erst die instanceOf Überprüfung, dann der Cast.
Standard Standart eines Flamingos ist einbeinig.

geoneo97

User / Kunde

  • "geoneo97" started this thread

Posts: 144

  • Send private message

3

Saturday, May 17th 2014, 8:25am

Ohlololol hab ich ganz über sehen

Danke

Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net

Similar threads