FallingBlock damage.

Discussion in 'Plugin Development' started by Kargond, May 30, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Kargond

    How to make FallingBlocks damage players as anvils do? I guess it is easy, but I can not find out how to do it.
     
  2. Offline

    Konato_K

    @Kargond I don't think there is a way to do this with the Bukkit API, however, the EntityFallingBlock class (NMS) has a method that accepts a boolean which defines whether the falling block should hurt or not entities.
     
  3. Offline

    Kargond

    I am sorry, but what is NMS?
     
  4. Offline

    VortexGmer

    Netminecraft.server dive into it and find the calling block and stuff
     
  5. Offline

    Konato_K

    @Kargond net.minecraft.server, the problem with using NMS is that it's version dependant, if you get the imports for net.minecraft.server.v1_7_R2 (craftbukkit 1.7.5) then your plugin won't work for v1_7_R3 (cb 1.7.9).

    A common solution is to use reflection, which doesn't work if the name of the member of the class changes between versions (in this case the method seems to be a(boolean), but it may be b(boolean) in a different version).
     
Thread Status:
Not open for further replies.

Share This Page