Git Product home page Git Product logo

minestomblocks's Introduction

MinestomBlocks

license platform

MinestomBlocks is a library for Minestom. It adds block sounds (e.g., placement and step) and block breaking animation.

The maven repository is available on jitpack.

Table of Contents

Features

Currently, the library provides the following functionality:

  • Block placement sounds
  • Player walking sounds
  • Player falling sounds
  • Block breaking animation including support for different tools, efficiency, haste and mining fatigue

Usage

To use the library, add it as a dependency to your project.

Before using it, you should call MinestomBlocks.init(). This will make sure everything is registered correctly. After you've initialized the extension, you can get an EventNode containing listeners which provide specific functionalities using the static methods in MinestomBlocks. To get all the features, use MinestomBlocks.events(). By adding these nodes as a child to any other node, you enable the feature in that scope.

Example:

MinestomBlocks.init();
MinecraftServer.getGlobalEventHandler().addChild(MinestomBlocks.events());

Integration

MinestomBlocks uses a custom listener for the ClientPlayerDiggingPacket. In case you want to implement your own breaking functionality, you should use PlayerDiggingActionEvent, which provides you with a method to set the handler.

If for whatever reason you want to access the BlockSoundGroup of a block, you can do so using MinestomBlocks.getSoundGroup(block).

How it works

MinestomBlocks uses ArticData to generate a file which contains information about blocks. Upon calling MinestomBlocks.init(), the library will read and parse the file. It stores information about which BlockSoundGroup each block belongs to.

Contributing

Pull requests are welcome! (If within the scope of this project)

minestomblocks's People

Contributors

togar2 avatar

Watchers

 avatar

Forkers

codestech1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.