Git Product home page Git Product logo

Comments (9)

tastybento avatar tastybento commented on September 20, 2024 1

UPDATED with latest commit:

Added these placeholders (BSkyBlock examples):

Level Placeholder
%Level_bskyblock-island-level% - the player's level

Top Ten Placeholders
%Level_bskyblock-island-level-top-value-x% where x is a number between 1 and 10
%Level_bskyblock-island-level-top-name-x% where x is a number between 1 and 10

If the top ten is less than 10 players then the placeholder will return an empty string.

To get the the values for other game modes, for example AcidIsland or CaveBlock, use the same format but with the Addon name in lower case, e.g. %Level_acidisland-island-level%

Tested using Placeholder API's parse command and they work.

e.g.

papi parse LSPVicky level %Level_bskyblock-island-level-top-value-10%
[21:37:20 INFO]: level
papi parse LSPVicky level %Level_bskyblock-island-level-top-value-1%
[21:37:23 INFO]: level 28
papi parse LSPVicky level %Level_bskyblock-island-level%
[21:37:38 INFO]: level 28

from level.

tastybento avatar tastybento commented on September 20, 2024

No, there isn't.

@Poslovitch Is there a way for the add-on to register placeholders?

from level.

Poslovitch avatar Poslovitch commented on September 20, 2024

Yes, but that'll need some boilerplate code. But that's possible .

from level.

Poslovitch avatar Poslovitch commented on September 20, 2024

More and more users are asking for this.
@tastybento Registering a placeholder can be done using this code:

BentoBox.getInstance().getPlaceholdersManager().registerPlaceholder(Addon, String, PlaceholderReplacer);

See the Javadoc for reference.

from level.

tastybento avatar tastybento commented on September 20, 2024

@Poslovitch Thanks. I'll look into this now.

from level.

tastybento avatar tastybento commented on September 20, 2024

Okay, added in commit 8eaca60
It needs testing.

from level.

tastybento avatar tastybento commented on September 20, 2024

commit 97fb434

from level.

tastybento avatar tastybento commented on September 20, 2024

This issue relates to this discussion: BentoBoxWorld/BentoBox#322

from level.

tastybento avatar tastybento commented on September 20, 2024

Note placeholder names now have the game mode in them so you can get them for any game mode.

from level.

Related Issues (20)

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.