Comments (2)
Rocky, the developer already told me he would be looking into this. He will later reply with new information.
from commandpanels.
This can be done using PlaceholderAPI, I have created an example item to explain.
You will need to use the JavaScript placeholder and hasvalue with CommandPanels combined. The example below will check to see if the placeholder "vault_eco_balance" which is the player's balance, is greater than 20 or not. If it is, it will return true, otherwise, it will return false.
This is why the value: true
can be done, because it will not be comparing a number, but only a true/false value. If you need to reverse the outcome, you can always change value: to false, or even change output: to false (they'll do the same thing in this case).
'23':
material: REDSTONE_BLOCK
name: 'You NEED $20!'
lore:
- '&cYou have $%vault_eco_balance%'
hasvalue:
output: true
value: true
compare: '%javascript_greater_than_{vault_eco_balance},20%'
material: EMERALD_BLOCK
name: 'You HAVE $20!'
To make this placeholder work, you will need to follow the javascript steps with PlaceholderAPI which is here:
https://github.com/PlaceholderAPI/Javascript-Expansion/wiki/Community-Scripts#how-to-use
When you get to the step that requires you to write javascript, I have done this for you, simply copy and paste this script I made into the greater_than.js
file:
var placeholder;
function gThan() {
if (args.length === 2) {
placeholder = args[0];
}else{
return false;
}
if (placeholder > args[1]){
return true;
}else{
return false;
}
}
gThan();
In the code above, you can see the section that says placeholder > args[1]
. Simply change the > to any javascript operator if you want it to be different (https://www.w3schools.com/js/js_comparisons.asp). Make sure to do /cpr and /papi reload when making changes to both plugins.
from commandpanels.
Related Issues (20)
- disapearing gui HOT 10
- Custome item in item-paywall= HOT 8
- Buy and sell commands don't works HOT 9
- msg= and /cpc aren't available HOT 19
- Is it possible to buy 2 commands ? HOT 2
- Impossible to \ in 1.8 HOT 2
- Has Sections HOT 23
- Enchante HOT 22
- Banner: not accepting placeholders HOT 12
- Cancel block-placement if right clicking the hotbar item while block(s) are in the offhand HOT 1
- Do you support mod items with nbt tags? Like Tinkers' Construct mod. HOT 2
- CommandPanels improperly parsing random placeholders as "null" HOT 1
- [Suggestion] Set default way of storing cpanel player heads to the head's value HOT 5
- HAS sections for the title
- Player can't sell item from MMOItems plugin HOT 2
- Individual player lore in example_middle_two
- tokenpaywall error and success messages HOT 4
- Panel Title taking input but not changing value HOT 1
- Add the ability to define placeholders on open panel with the API HOT 2
- I want the sell= command tag to be able to recognize custom model data HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commandpanels.