#help-archived
1 messages · Page 136 of 1
because of how clients & bukkit work and all, it might call a block damage event on the fake block, letting you reset the state & cancel the event
meh ill just resend a packet if they break the block, kinda hacky but it works i guess
cancelling the block break packet when the dig type is STOP_DESTROY_BLOCK doesnt cancel it like i would expect
thats the issue im running into
if that makes more sense
For about the past week, the spigot version api (https://api.spigotmc.org/legacy/update.php) has been giving me a 403 when I try to get it from my server using php. It works fine when using a browser. Is there some new cloudflare rule?
@dim cape make sure you have a user agent
i dont think i do, thanks
i never have so not sure why it suddenly stopped working the other day
yep working now that i set a user agent, thanks again
yo the command /minecraft:kill @e[type=horse] returns unknown entity
on version 1.8.8
1.8 has been unsupported for 4 years
yeh, but for me personally, I need to use it.
That's fine but don't expect any support here
alright
@frigid ember /kill @e[type=EntityHorse]
😥
😃
No problem
Pigs are next, and finally dogs. 😈
Does anyone know how to make an nbt chest with the spigot api? I assume you can do it through the ItemMeta but I don't really see how you would do it
BlockStateMeta --> set it to a chest with the desired contents
I was meaning more for the chest item not block
ooh, I see
epic, got it working 🙂 thanks
so uh
lookin at schematic format
unsure of how to translate the 8-bit thingy to a block
Can't be its internal ID because those are integers I believe, 32 bits
There's no specification on that?
yeah 8 bits tends to be a byte
Right... though blocks don't fit within the range of a byte. There are definitely more than 255 blocks
Especially because states are included in that and make it exponentially larger
Probably the old file format
Still has it implemented on master
I said it once and I'll say it again
WorldEdit's api docs are next to war on the worst things that exist
I just switched to using Mojang's structure format
So that explains the "how can blocks fit within 255 numbers?" question
slime world format >> all
and block data is stored in ANOTHER array
So 3 byte arrays of block data
Though that's still legacy data as far as I can tell
oh thanks choco i was trying to look for that just now
saw that somewhere else but github page was outdated
Ye. The wiki you linked links to different implementations
all of this is very confusing
What
how is that confusing lol
The first sentence says it all
I'll spell it out for you
In computing, a nibble[1] (occasionally nybble or nyble to match the spelling of byte) is a four-bit aggregation,[1][2][3] or half an octet. It is also known as half-byte[4] or tetrade.
woah
you dont have to be so harsh lmfao
im just saying in general
this byte stuff is confusing
Technically 1024
You're welcome.
You said the byte stuff is confusing
Imagine you just have a list of bits
Because that's what the computer actually sees
It's just a big long list of bits
Doesn't matter if you split them into groups of 8, 32, 64, 4, 2, or don't split them at all
i know what bytes are
What's the byte stuff
What "byte stuff" is confusing you then?
I'm trying to load a ZonedDateTime I turned into a string and save into a file, but it remains null on startup. How exactly do you parse a string into the ZonedDateTime object?
could use gson
ObjectOutputStream is a thing everybody here seems to forget exists
Also more efficient serializers exist like FST or JBoss Marshalling
im just suggesting a simple readable solution idk
idk why everybody sucks off gson
seems like what hes going for
...he's trying to serialize something
well maybe he is, didnt say that
I just did .toString() on it
yea sometimes thats not the best ;P
Don't toString() it. Format it
but you have the option of saving it as json via gson, or using a serializer to make it into a string, or parse it your own way
oh yea its a time
probably could do that lol
Extract the data you need to initialize it from scratch, and save that as a string
I was originally trying to do this with a Date, but when loading from files it resulted in weird values.
When you want to initialize, parse your string and then re-create the object from scratch
What do you mean format it?
ZonedDateTime can be formatted using DateTimeFormatter.ISO_ZONED_DATE_TIME
and reparsed from String
ZonedDateTime.parse(string, DateTimeFormatter.ISO_ZONED_DATE_TIME)
(actually that second argument is redundant. There's an overload that assumes that as the default)
....i should read JD more LOL
I know that because I just recently worked with that very same API for my locked blocks
How would I use the DateTimeFormatter to format it into a string?
zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME)
There's a format() method for all temporal objects
I'll give this a shot, thank you very much for your help!
o/
meh worldedit has their own thing for translating the block id to an actual block
😭
Schematica has this line
but its a mod so
works slightly differently
idk if theres a similar implementation on nms/spigot
final Block block = Block.REGISTRY.getObjectById(blockID);
well theres this actually
net.minecraft.server.v1_15_R1.Block.REGISTRY_ID.fromId()
my problem was that I was doing zonedDatedTime.format() and not setting it to the original object lol
my bad
just fixed it
Could anyone help me in dms? I want to take some time to recode one of my project with proper design patterns and structure, I understand how they work I just need help applying them to my concepts
I just looked at this post https://stackoverflow.com/questions/17485297/how-to-instantiate-an-inner-class-with-reflection-in-java
It seems that, in reflection, it is implied that the first argument for a nested class constructor is reserved for the enclosing instance. Is this true? If the class is a nested type (and not static), and I want to use one of it's constructors, should I pass an enclosing instance as the first argument?
I just wanted to make sure I'm not misinterpreting this... reflection in this regard seems much different than regular code
It kind of reminds me of Python, where you have self or cls as the first argument for a method in a class
can you help me with a couple of plugin problems ?
@warm vine which plugins?
Does someone know plugin for block stacking
which supports 1.13+
I need it for my skyblock server
Yes
For people to gain levels on skyblock
looking for a plugin that adds more types of tnt :>
i asked first
can someone help me understand why instantiating an interface works here? im kinda new to java and i cant find an explanation anywhere :(
That’s parameters and you’re not initiating. You’re just telling any instance that has a supertype of that interface can be there when invoking the method.
thanks! someone else ended up dming and walking me through what it was doing, but i appreciate the explanation!
Is there a plugin that adds bots that can interact with their environment? (example, pvp or mining blocks)
AI functionality or just in presence?
I thought that too
but in hypixel skyblock dungeons there are npcs that go after the player
I might not have seen enough
they might not actually attack
but still
Well hypixel is hypixel after all
yeah but don't they use spigot
well does anyone know how the npc plugins work?
maybe the mechanics they use can also be used for attacking and stuff
they just don't use it
There are lots of ways to do custom npcs
Do you mean an NPC as in a player entity?
yeah
I mean, you'd have to code it yourself but yes
You'd probably have to code your own plugin. There are plugins out there that have custom NPCs that attack, but I haven't seen one that was as customizable as you're probably wanting.
hmm
thank you for the help you've given me so far
do you know where I could go to start?
If you want to just use a plugin, Citizens has the Sentry character trait that makes NPCs attack. It's pretty customizable.
is citizens paid
cool
AFAIK
I have background coding experience, but I haven't coded in java. I'll probably pick it up fast because I recognize a lot of the ideas. Which plugin could I use to code a pvp bot?
sentry could work for that
but not entirely sure how, what languages do you have background in?
i could never get into lua, gl man
suggest learning Java first before making any plugins though
yeah lol I'm gonna do that
I'm just getting the stuff ready for when I do know it for motivation and so I can start right away
:)
I suggest learning java while making plugins, not in beforehand
It’s a really good combination
it's not bad but fundamentals of the syntax are pretty good to know :)
That’s pretty easy, if he touched python and lua that won’t be hard to learn
I know nothing about python but yeah you're probably right
Thank you all for your help!
np<3
So I'm kinda confused, In the Spigot plugin tutorial it shows how to make a config.yml but I dont know where to write the code its showing
what spigot tutorial?
Code it’s showing?
are you using an IDE?
Yes, Eclipse
first off I suggest using intellij over that
Yeah I'm familliar with eclipse more
I understand :)
So I don't know where im supposed to write this
@raven hound well you could put it in any class but That’s in main class
in onEnable
yeees?
When I was doing the Event API tutorial (https://www.spigotmc.org/wiki/using-the-event-api/?noRedirect=1) I didn't know where to write this either
How do you place text at the bottom of the screen? Like in super vanish
actions bars https://www.spigotmc.org/resources/actionbar.1458/
Lmao noone helps me :(.
hamoudy
Why are you creating your own event ?
No need if it’s not an API you’re creating
can someone help
the command suggestion on my server not working for default players but when op they can
Example when u type /t it will show other suggestion command like /tpa /tp etc.
but now it shows unknown command at position 1
actions bars https://www.spigotmc.org/resources/actionbar.1458/
@opal bay thanks, but I want to do it with a self made plugin
Ok, @naive goblet but when i put this in my main class (onenable) i got lots of errors
So I don't know where im supposed to write this
@raven hound send the errors
Yeah one sec
@frigid ember youre trying to load a world or a chunk from a newer version
@remote crown you want to make your own action bar plugin?
@raven hound but i am using 1.15.2
¯_(ツ)_/¯
you can’t really just copy paste the code
?
Well when you’re raw copy pasting you will end up with syntax errors etc
yeah ill modify a bit and get back to you
k ill do that
That’s a configurable message?
Hmm what plugins do you have ?
oof
I mean it’s probably a plugin that commits something whenever a player joins the server
Hi guys, need a simple answer. (I never played Factions). Does a faction claim represent a chunk ?
Okay then a Faction claim is a chunk region
If I want to monitor player enter and leave, just have to check when the player change chunk
Yeah well a bunch of chunks
Okay right thanks
Yep Rolyn
ty
I'm getting one warning. Description Resource Path Location Type The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (MythicEvent, MythicalModeration) MythicalModeration.java /MythicModeration/src/com/gmail/ line 14 Java Problem
maybe check console for errors
I'm getting one warning.
Description Resource Path Location Type The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (MythicEvent, MythicalModeration) MythicalModeration.java /MythicModeration/src/com/gmail/ line 14 Java Problem
anyone have a clue?
@frigid ember Do you have a plugin that make the player or the server execute a command on login ?
itshamoudy is it your plugin?
hamoudy send code
^
``
import org.bukkit.plugin.java.JavaPlugin;
public class MythicalModeration extends JavaPlugin {
// Fired when plugin is first enabled
@Override
public void onEnable() {
// Register our command "kit" (set an instance of your command class as executor)
this.getCommand("kit").setExecutor(new CommandKit());
}
{
getServer().getPluginManager().registerEvents(new MythicEvent(null), this);
}
// Fired when plugin is disabled
@Override
public void onDisable() {
}
}
``
this is where the error is
And wtf new MyhticEvent(null)
Put you're getServer().getPluginManager().registerEvents(new MythicEvent(null), this); inside the onEnable method
what’s the null for?
And yes, wtf is your MythicEvent constructor ?
Well i was just following eclipses intstructions to fix some errors
Don’t lol
Simo not a single error just that?
Eclipse won’t fix anything for you sorry
Put you're getServer().getPluginManager().registerEvents(new MythicEvent(null), this); inside the onEnable method
isnt it already in?
Okay send ur MythicEvent
You should probably put this instead of null
But not sure
No it's not, you opened Brackets no where itshamoudy ^^
can someone help
the command suggestion on my server not working for default players but when op they can
Example when u type /t it will show other suggestion command like /tpa /tp etc.
but now it shows unknown command at position 1
Are you working with the TabCompleter?
Yap like that
No it's not, you opened Brackets no where itshamoudy ^^
where exactly?
How’s the code looking Sensei?
mine seems have problem before its working perfectly
Send
Oh
Yep i cant figured out why its happening
i enable it on spigot.yml
What did you put?
0
commands:
log: true
tab-complete: 0
send-namespaced: true
spam-exclusions:
@raven hound ```java
{
getServer().getPluginManager().registerEvents(new MythicEvent(null), this);
}
This is not inside the onEnable() {
}
It's in an init block
Ok thanks
is this correct?
// Fired when plugin is first enabled
@Override
public void onEnable() {
// Register our command "kit" (set an instance of your command class as executor)
this.getCommand("kit").setExecutor(new CommandKit());
}
getServer().getPluginManager().registerEvents(new MythicEvent(this), this);
}
// Fired when plugin is disabled
@Override
public void onDisable() {
}}
Anyone know how to check through spigotmc whether the latest version of the plugin is installed, and possibly add the possibility of an update under the command?
default players always see unknown command at position 1
@raven hound there is a closing bracket under this.getCommand.... which shouldn't be there
Then fix them
this is why i was asking here XD
Just because it shows the other errors now doesn't mean that you magically generated them.
maybe a perm
they just see default players always see unknown command at position 1 when typing commands
what should it be ?
Do you have luckperms?
i use permissonex
Why?
@undone narwhal check dms
is there a perm node needed ?
i add crazyenchants
and this all happens
i tried to uninstall it
but nothing happens
did you remove its folder
Yeah I did
seems intresting ¯_(ツ)_/¯
confuse rn
Just because it shows the other errors now doesn't mean that you magically generated them.
yeah but i need help fixing them, its my first time making a plugin
@slate ocean Can you please stop spamming me ? Thanks.
What is the DamageCause when a player quit the world bottom bedrock ?
( ping me pls )
really confuse now
.set(player.getUniqueId(), player.getLocation())
Something similar to that
I just assumed you wanted to save it to a yaml config
- bob:
world: name
location:
x: 0
y: 0
z: 0
- john
world: name
location:
x: 1
y: 1
z: 1
something like this
Open your src file, and search for a blue folder
ohhhhhhhhhh
you set keys to values
really that simple
loop through your "players"
set the world to the world's name
wait i'm honestly confused.
is targetID a string
.toString()
targetID.toString(), targetLoc
@vagrant widget dude
you're using maven
you put the source files
in src/main/java
and your test files
into src/main/test
so right click the blue "java"
Your packages go into "java"
Location location = (Location) getConfig().get(player's uuid as a string)
player.getUniqueId().toString()
lol
Location location = (Location) getConfig().get(player's uuid as a string)
@steady cedar You can use getLocation
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/ConfigurationSection.html#getLocation-java.lang.String-
^ or that
neato
probably does the same thing under the hood
@frigid ember try learning java
you won't be so confused
Location location = getConfig().getLocation(player.getUniqueId().toString());
that's-
that's how you get it
lol
And im confused because I keep getting the same error:
// Fired when plugin is first enabled
@Override
public void onEnable() {
this.getCommand("kit").setExecutor(new CommandKit());
getServer().getPluginManager().registerEvents(new MythicEvent(this),;
}
// Fired when plugin is disabled
@Override
public void onDisable() {
}}
getServer().getPluginManager().registerEvents(new MythicEvent(this),;
that line is incomplete
lol
wow
what enchantment can I add to an item just to give it a cool shiny effect?
why are you using a comma?
getServer().getPluginManager().registerEvents(new MythicEvent(this),this); @raven hound
Cause eclipse said this isn't cool
yeah thats what i put
@pastel condor Depending on you're version, you can even create a custom glow encahnt
@frigid ember check first if the location is null. If there is no entry in the config with the player uuid you will get a NPE
getServer().getPluginManager().registerEvents(new MythicEvent(this),this); @raven hound
@high root did that same error
@raven hound listen to me
yes
learn java, and you won't have such a tough time
i know it hurts when i say it, but dog
please
if you want to spare others the pain of helping somebody who's never touched java
learn it
ouch
thanks
@high root did that same error
@raven hound How does the constructor of the MythicEvent class look?
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class MythicEvent extends Event {
private final String playerName;
public MythicEvent(String playerName) {
this.playerName = playerName;
}
private static final HandlerList HANDLERS = new HandlerList();
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
public String getPlayerName() {
return this.playerName;
}}
LMAO
Oh
I'm gonna SOB
I see the problem
us too ^
I think he wats to create a custom event
^^^
then why did you
register the listener
you know what
I can't even blame him
that's retarded language
registerEvents lol
Ok, @raven hound
Ignore the name of the method, that actually means "registerListeners"
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "command goes here without /");
that convention always confused the hell out of me
no / in dispatchCommand
yes / in PlayerCommandPreprocessEvent
tf is that
@raven hound
getServer().getPluginManager().registerEvents(Listener, Plugin) is used to REGISTER listeners. To create a custom event you don't do that
Quick question, how do I reset a world? InstantReset plugin somehow doesn't work for me
Nemo, I was trying to make a message on join
Nemo, I was trying to make a message on join
@raven hound Then create a class called, for example, OnPlayerJoinListener. Make that class implement Listener. Then create a method called onJoin with parameters PlayerJoinEvent. Then on your main class register it using getServer().getPluginManager().registerEvents(Listener, Plugin)
@raven hound Then create a class called, for example, OnPlayerJoinListener. Make that class implement Listener. Then create a method called onJoin with parameters PlayerJoinEvent. Then on your main class register it using getServer().getPluginManager().registerEvents(Listener, Plugin)
@high root thanks
spoonfeed XD
how do I get all the args after args[2]
@frigid ember
for(int i = 2; i < args.length; i++) {
// CODE HERE
}
hahahahahaha it's the joek
ur misleading him bro
bRo
statements end with ; in for loops
hOw
@opal bay it started because of a reason
but
like a string reason
but even then it's wrong
oh okay
god arrays are annoying
he also needs ;;
hey let's start the array at zero but count it from length at one
god arrays are annoying
@opal bay Ther are usefull if you understand them
no shit lol
here's why
stringbuilder
for (int i = 2; i < args.length; i++) {
append to stringbuilder
}
yes
of type StringBuilder
and when I say append to stringbuilder
you want to append args[i]
xdxdxdxdxdxd
separated by a semicolon
also not separated by a comma
@steady cedar True I miss that one
@frigid ember i'm not gonna spoon feed you any longer. learn java
spork feed
omg
why would i be null
i'm starting to feel @steady cedar
Jochyoua has left the server.
If no ban reason is specified the args length won't be that long
and i is an int that is already defined so either way
pain
Im going to wite i need time
@frigid ember
Just look up for loops
on google
and it'll click INSTANTLY
trust me
Pain
i swear to god if you go to another discord asking the same question
hurt me
@frigid ember
if a player uses the command
/yourplugincomand firstArgument secondArgument thirdArgument
The in the args var the indexes are
args[0] = firstArgument
args[1] = secondArgument
args[2] = thirdArgument
To join this you can use a stringbuilder and the append method
the with sb.toString you get your new string
how?
the arguments STARTING at the second index ENDING at the MAXIMUM index(so the amount of arguments)
THOSE are the ones you wanna put together
So you want to add to a string repeteadly
repeatedly idk
how to spell
Now what do we do when we want to do something repeatedly
We use a for loop(or a while loop)
wow
"do that but in java"
in python it's
for i in range (1, 10)
@frigid ember This is not python. It is not that diferent
"for in range in java"
https://oof.ddns.net/u/03.56.42-22.06.20.png gee thank
@opal bay or
and know how to do it next time
|| means or, && means and
That's AN INFINITE LOOP
i know
NoDONT DO TAHT
while (5 > 3) {
@frigid ember while repeats the loop as long as the condition between the parentesis is true. Since 5>3 is ALWAYS true, that will enter a loop and never get out
Honestly learning how to code is basically learning how to use google
so what I want to do is make it keep checking args[2], args[3], args[4] and so on and so forth, and once it comes upon an empty one it stops
@frigid ember Whe nyou get an indexoutofboundsexeption
No just use a for loop

don't overcomplicate this
I haven't used while in quite a while
lookup for integer loops in java
look up "for integer loops in java"
and you'll understand
the link I sent has literally code specifically for that lol
if someone just gives you code
No need to add the integer to de search, beacuse for loops are used almost always with integers
better idea
depends
@frigid ember usa a foreach loop
no
true
he wants to start from 2
he wants to start at 2
@frigid ember args.length
that's the limit
you stop when the index is the length of the arguments
Remember length returns size and indexes start at 0 as well 😉
for (i = 2, i < ??????, i++) {
@frigid ember almost
for(int i = 2; i < args.length; i++)
@frigid ember take a look here
https://codingbat.com/doc/java-array-loops.html
is i defined already?
you want to declare a stringbuilder outside of that loop
yes int i = 2
Now outside of the for loop(right above that statement) make a StringBuilder
and inside of that for loop(under that statement) do stringbuilder.append(args[i]).append(" ");
You probably also want to append " "
what that does
is it adds to the string builder
the string at index i
and adds a space
then use String str = stringbuilder.toString() to build the string and store it in str
also hold on
@frigid ember wat
did you forget the { ?
Show it please
Omg
of
look
if(confition1) {
if(condition2) {
some variables
for() {
code in for loop
}
} else {
other stuff
}
}
You are trying to acces the " some variables" from "other stuff" but they are not in the same {} block
if(confition1) { if(condition2) { some variables for() { code in for loop } } else { other stuff } }You are trying to acces the " some variables" from "other stuff" but they are not in the same {} block
@frigid ember you have this problem
are you in eclipse?
press ctrl+shift+f to autoformat your code
str will NEVER be null
the only thing that it can be is empty
so when you do "ban" + player + " " + str it will get converted to "ban player "
empty is not the same as null
Also playerBanned is a a Player not a String so you want to use playerBanned.getName()
if (str.isEmpty() == false) {
@frigid ember str.isEmpty() returns true or false so doing
str.isEmpty() == false is the same as doing
true == false or false == true
and that comparison doesn't make much sense
look, you check if str != null, this ALWAYS will be true because in this case str can not be null, the only thing that can be is empty
and it doesn't really mater if it is empty
NONO
That will ALWAYS be false
just omit the check
if str is empty
then when you add it to form the command nothing will be added
Also @frigid ember , you have your dispatch command inside the for loop. This means that every iteration the command will be launched
Because you have to move str outside the loop
If not, you create a new str every iteration
Simo, it will always atlwast be “ “
@bold anchor No
Are you blind? I can literally see it
@bold anchor if i strarts being = or > than args.length the for loop won't run
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "ban " + playerBanned.getName() + " " + str);
@frigid ember good
explain
PlayerPrecommandProcessEvent thingy
private final EnumSet<Material> types = EnumSet.of(Material.LOG, Material.LOG_2);
if (woodDestroyed.get(player.getUniqueId()) >= 2) {
if (chance >= 10) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 2));
} else if (chance >= 25) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 1));
} else if (chance >= 65) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 0));
}
}```
Currently have this but it has to be ALL logs so I probaly cant use an enumset cuz its 1.8.8 and it also has to catch the block and only give the material if it is a LOG and it also shouldnt add in the inv actually but where the block is destroyed
so maybe this instead of material but than it counts for each block event.getBlock().getType()
@frigid ember can you explain more what you want to do with the helpop?
use permissions and a permission manager like luckperms
wat
oh
ok
@frigid ember
Have a list where you store the players that you did the /check command on and listen to PlayerCommandPreprocessEvent. If the player that runned the command is in the list cancell the event
@frigid ember what d oyou want to do?
so in @EventHandler?
@frigid ember In a class that implements listener, in a method with the @EventHandler
basically get some fortune when you mine logs after achieving a certain amount of logs before you get it
is there a simpler way to disable commands?
@frigid ember Yes
Have a list where you store the players that you did the /check command on and listen to PlayerCommandPreprocessEvent. If the player that runned the command is in the list cancell the event
basically get some fortune when you mine logs after achieving a certain amount of logs before you get it
@frigid ember Listen to block break event, check if it is a log, do something
u sure?
private final EnumSet<Material> types = EnumSet.of(Material.LOG, Material.LOG_2);
if (woodDestroyed.get(player.getUniqueId()) >= 2) {
if (chance >= 10) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 2));
} else if (chance >= 25) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 1));
} else if (chance >= 65) {
event.getPlayer().getInventory().addItem(new ItemStack(Material.LOG, 0));
}
}```
Currently have this but it has to be ALL logs so I probaly cant use an enumset cuz its 1.8.8 and it also has to catch the block and only give the material if it is a LOG and it also shouldnt add in the inv actually but where the block is destroyed
I have this rn
but the enumset doesnt hold bytes
event.getBlock().getType()
and this instead of material.kig
event.getBlock().getType().toString().contains("LOG") @frigid ember or something like that
but I have multiple materials
event.getBlock().getType().equals(Material.mymat)
@pastel condor Don't use equals with Enums, use ==
it has to give fortune on oak if it is oak
fortune on birch if the player destroys birch
😑
@EventHandler
public void PlayerCommandPreprocessEvent(PreprocessEvent e) {
@frigid ember oh my god
@EventHandler
public void onPlayerSendCommand(PlayerCommandPreprocessEvente e) {
fortune on birch if the player destroys birch
@frigid ember getblock().getdtata or something. I don't know I havend used 1.8.8 in ages. get the block, check if it is a log, check the type of log
@frigid ember Why are you making this so hard for yourself? ```java
event.getPlayer().getInventory().addItem(new ItemStack(event.getBlock().getType(), amount, event.getBlock().getData()));
^^
that'll only work for oaklogs?
No
because you create an item stack with the block data
but idk
1.8.8 is really old
Hey, I'm having a issue with bungeecord, can someone that knows a lot about bungeecord message me.
you shudn't use it
@high root I'm on 1.7.10 lol
xd
u e crazi
There's a lot of people still using 1.7.10
probaly for hcf or something
^^
yes
I have a hcf server ;p
nice
how do I find if the player is in the config list
@frigid ember how are you saving the player in the config?
when the staff member does /check %player% it saves him
@frigid ember like, players.playeruuid or something like that
store their UUID and then get it through the same method
It kinda works @rustic socket
if only the x log is included
now it does it for everything
every log
isn't that what you wanted, @frigid ember?
no it also does it for grass
give multiple
I need it only to do that for each type of logs
so oak,birch,darkoak etc
it's your job to filter which blocks to apply it to
yes but what should I use to do it in 1.8.8
the code for that has even already been given in this conversation
targetName = uuid as a string
@frigid ember Then use ConfigurationSection#contains(String). You would hace to do
if(youronfigFile.contains(player.getUniqueID().toString)) {
do something
}
^^ yes
Sure, try that
This is where the boolean OR operator comes in
maybe
But than I have to include multiple if statements
to do the next step
if statements x amount of logs
PlayerCommandPreprocessEvent will get launched every time a player uses a comand
or do you mean whether the command you want them to execute is successful?
event.setCancelled(true)
When you want to know if a class has a method, go to the api and search or it @frigid ember
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerCommandPreprocessEvent.html#getMessage--
gtg bye
no
helpop is usually used with more arguments
if (!e.getMessage().startsWith("/helpop"))
Of yeah
so getMessage will get you something like:
/helpop why u teleport me
for example
No clue, try it and see
I'll probably do more like !e.getMessage().toLowercase().startsWith("/helpop")
I think you should put the / not sure but Idriz told it previously
how do I post it on spigotmc
@frigid ember Create an account, go to Forums>Spigot>Spigot Plugin Development
https://www.spigotmc.org/forums/spigot-plugin-development.52/
and create a post with the Post New Thread button
Simon
That is the spigot development
For questions avout development of plugins
Like what you were doing a moment ago
to post a resurce is here
https://www.spigotmc.org/resources/
Can someone help
commands:
log: true
tab-complete: 1
send-namespaced: true
spam-exclusions:
- /skill
silent-commandblock-console: false
replace-commands: - setblock
- summon
- testforblock
- tellraw
non op players dont have command suggestion
do they have permissions for the command
and most importantly... does the plugin have command suggestion?
not all do 🤷♂️
so EssentialsX?
yap
are you using a permission plugin like LuckPerms?
Permissionex
.-.
Why are you not using luckperms?
should i ?
are you on 1.15.2?
yap
Luckperms works from 1.7 -> latest
yeah it works everywhere basically
but before i dont have this error
after i add crazyenchant this happen
what should i do ?
Well, permissionex also has lots of exploits.
And the plugin is probably the cause then, this crazyenchant
For the record pex is outdated and doesn’t have any up-to-date safe version afaik
I think PEX2 is probably still not going to compete with LuckPerms
Depends
I mean it’s pretty unnecessary to invent the wheel again so probably not
Even though luckperms is great some people just don't feel like using it.
Luckperms is great atm, but people still use the old outdated pex
@bold anchor I know insanely big server (even running on bungee) still using it
yah im kinda used to pex
and they insulted me because i told them to change it lol
Most people use pex because it’s pex not because of what it actually is
owo yes
I mean essentially pex works fine but use LuckPerms if you can and avoid pex
you can also import permissions from PEX -> LuckPerms
so you don't need to re-write them by hand
one sec
It's called migration
They also have an active discord
yeah it's bigger than this lol
Hey, how can I enable my plugin before all of the others?
You can load it on STARTUP, but other plugins would have to depend on your plugin for it to load before before others.
you need others to depend on it
so i always get a null pointer exception
Then make the lobby system depend on the api as i said.
Probably
Okay, I'll try
Nope
Still a nullpointer exception
oh no
it loads before
but i still get a null pointer exception
i don't understand
then ur code has something wrong in it
like
its working within the api
but when i try to access it via the lobbysystem
it throws a nullpointerexception
HAHA OMG
sorry
im so dumb
What is the line with the NPE ?
Sorry mb
i tried to use a method
which is called one line later for initialization
ooof
Thanks for ur help! ❤️
🦐
if i remember correctly
lp user <name> parent set <group>
not sure tho i haven't administrated servers in some time
I’d use add instead of set
its kinda hard to use luckperms Xd
how do i use prefix of luckperms
since im using essentials for prefix
lp user/group <name> meta addprefix <weight> <prefix>
the prefix not showing hmmm
what placeholder should i use on essentials
{GROUP} ?
https://api.spigotmc.org/legacy/update.php?resource=80491
Please help!
When will the api update? I have already inserted a new version of the plugin and it is visible.
is there a list of commands this plugin adds anywhere?
which plugin
spigot/bukkit 1.15.2
https://api.spigotmc.org/legacy/update.php?resource=80491
Please help!When will the api update? I have already inserted a new version of the plugin and it is visible.
omy
how to set default rank for this ?
luckperms
rip
still got the error
non op still cant see suggestion cmd
will I get an answer here or stupid spam?
i made the three gm commands (a, c, s) using this code
if (p.getGameMode().equals(GameMode.CREATIVE)) {
if (p.getGameMode().equals(GameMode.ADVENTURE)) {
if (p.getGameMode().equals(GameMode.SPECTATOR)) {
p.setGameMode(GameMode.SURVIVAL);
Bukkit.broadcastMessage("Your gamemode has been updated to survival!");
return true;
} else if (p.getGameMode().equals(GameMode.SURVIVAL)) {
Bukkit.broadcastMessage("Your gamemode is already surviva;!");
return true;
}
}
return true;}
return true;}}```
but when i used this code my commands stopped working
it just does nothing
getCommand("build").setExecutor(new BuildCommand());
Idk why, but i am getting a error in this line
NPE
Did you register build in your plugin.yml?
uhm
JanTuck
I did do migrate the pex to luckperms
then now they dont have perms
how do i fix it :<
Look on the luckperms wiki or ask on their discord for more help
can someone help me with my error above?
YOu can help me with log spam?
My VPS server is spamming log hrs.err.pid.<Number>.log
@raven hound Have you put the build command in the plugin.yml?
?
if (p.getGameMode().equals(GameMode.CREATIVE)) { if (p.getGameMode().equals(GameMode.ADVENTURE)) { if (p.getGameMode().equals(GameMode.SPECTATOR)) { p.setGameMode(GameMode.SURVIVAL); Bukkit.broadcastMessage("Your gamemode has been updated to survival!"); return true; } else if (p.getGameMode().equals(GameMode.SURVIVAL)) { Bukkit.broadcastMessage("Your gamemode is already surviva;!"); return true; } } return true;} return true;}}```
this is my error
nothing happens when i do one of these
and my commands are registered and i put them in the plugin.yml
You are doing
if(player.getGamemode == CREATIVE) {
if(player.getGamemode == SPECTATOR) {
if(player.getGamemode == ADVENTURE) {
}
}
}
but how is going the game mode of the player to be all those at the time? I think you have to use ||
how do i make it if the player has a different gamemode then ex. survival it turns it to survival
oh k ill do with ||
wait but theres no == in my code
🤨
Just wondering, does EntityInteractEvent trigger when stepping on a pressure plate?
Or if not, an event that does
It does and the action enum is PHYSICAL
ok thanks!
@raven hound I'd suggest learning Java first before doing anything
Not even Java actually just programming fundamentals
Check if their source code is available
ehm you know