#help-development
1 messages · Page 1926 of 1
cant believe people actually fall for those things
what did i miss with that acc ?
@EventHandler
public void onWellClick(PlayerInteractEvent event) {
if (event.getAction() == RIGHT_CLICK_BLOCK) {
Player player = event.getPlayer();
World world = player.getWorld();
Location clickedLocation = event.getClickedBlock().getLocation();
Location wellLocation = new Location(world, -1197, 70, -1060);
System.out.println(clickedLocation + " | " + wellLocation);
if (clickedLocation == wellLocation) {
player.sendMessage("Chi");
}
}
}```
The sout locations --> Location{world=CraftWorld{name=world},x=-1197.0,y=70.0,z=-1060.0,pitch=0.0,yaw=0.0} | Location{world=CraftWorld{name=world},x=-1197.0,y=70.0,z=-1060.0,pitch=0.0,yaw=0.0}
It isn't printing "Chi"
oh wow
You can't == compare Location instances, akex
oh
what does "compomised" mean?
If you google "equals() vs == Java" you'll get lots of info on it
Credentials stolen, Gepron1x
== can be usefull, but you really know when to use it
In 99% of cases, you do not need it
It works :D
For object comparisons that is
fake discord gift link
downloaded malware or leaked their login qr code or entered their details (how, ikr)
Or they just straight up put in their password and username
The interact event is fired once for each hand, akex, so you can ignore one of them by checking the event's getHand()
Because they think they will get nitro
dumb enough
if (event.getHand() == EquipmentSlot.OFF_HAND) {
return;
}```
Or a skyblock mod
(valid use of == vs equals() btw lol)
That's because these are constants
back to the days where one of my friends got such a link for facebook and we just decided to send them 500k random names + passwords xD
Enums and primitives
What happens if you accidentally put in a correct combination?
That’s the main usage
engineerman did that, he found that a scam website used a service to validate card credentials, costed a couple cents per request
he used to work in retail and he knew a code that bypassed the checks
he sent like 70k requests 😂
Here we go again, another day, another scammer. This time a scammer decided to use a live payment processor to test validity of cards to scam. Not very smart and he'll pay because of it.
Hope you enjoyed the video!
Join my Discord server and come say hi:
https://discord.gg/engineerman
Check out some code on my GitHub:
https://github.com/realt...
its funny to see how long it takes for them to take those websites off xD
Honestly maybe we should be attacking those discord scams with scripts
that returns a string?
I LOVE THAT VIDEO
No it returns an EquipmentSlot
How would I make it for detect if it's HAND
This
That's what that snippet above will do
It will return (not proceed) if it's the off hand
How to fix KB so it doesn't pull players into the ground?
package playertracker.playertracker.utils;
import org.bukkit.ChatColor;
public class color {
public static String translate(String message) {
return ChatColor.translateAlternateColorCodes('§', message);
}
}
Is there something wrong with this code?
it isn't replacing
Use '&' not '§'
the § is for bedrock 🥴
Java uses it also, but if you're using translate alternate color codes the char provided should be the same in your string.
If the string was `§e... §6... §e..." it would've worked also.
Well, it wouldn’t have really done anything
I can use § in a message ant it'll send with color
For me it doesn't get sent in chat lol
like in p.sendMessage or broadcast
someone here knows about ChunkGenerator? im trying to make a Smooth Biome transitions but i cant, asking for help
Is it possible to send "fake armor" (place an item on a player's head without taking up the slot) but still have the item appear?
No
You cannot send a fake armor to the player without changing his inventory
yeah, thats a good way to do this
I could do that with a cmd block
but i didnt recommend
why
lag issues, and the armor stand will not be perfectly fixed in your body
Armor stands can be sent client side, and one or two wouldn't be laggy. They would be fixes assuming they are mounted
that being said... I'm using client side armor stands for multi line name tags at the moment, so a fake armor solution would be better
🤔
I think you cannot ride an client-side entity in a player
ive tried that a week ago
The armor stands are riding the player
Client-side armor stands?
yes, fake entities sent to the player
Check this out (not made by me) https://www.spigotmc.org/resources/tagapi.97399/
I didn't know this was possible, thanks for the info
What does this mean?
[22:33:04 ERROR]: Caught previously unhandled exception :
[22:33:04 ERROR]: Paper Async Task Handler Thread - 17
java.util.ConcurrentModificationException: null
at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1486) ~[?:?]
at java.util.TreeMap$ValueIterator.next(TreeMap.java:1531) ~[?:?]
at net.minecraft.commands.Commands.fillUsableCommands(Commands.java:419) ~[?:?]
at net.minecraft.commands.Commands.sendAsync(Commands.java:378) ~[?:?]
at net.minecraft.commands.Commands.sendCommands(Commands.java:368) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
When this happens?
when reloading a plugin
are you sure that is this the full error log?
i think is a corrupt jar file
try removing your servers plugins one-by-one, until the error disappears
restarted the server and it's perfect
idk what hapened
are you using paper?
purpur
ChunkGenerator Smooth Transitions
when you reload the plugin, are you reloading the config or the WHOLE plugin
idk I am using plugman
don't
suppose the whole plugin because I am uploading the plugin again
reloading plugins instead of restarting breaks everything
lol men plugman broke plugins, they reload instead restart
and causes unnecessary problems
but I don't want to restart the server every time
dont use that, i recommend only for developers that assume the risk
just never reload or restart
then?
Has anyone ever needed to create a potion with 1 line before? Is that possible?
stop the server and never turn it on again
I code the plugin perfectly at first try
I always /reload in dev
same
But I know my plugins can handle it properly
👏
No, reload is pretty terrible.
no if you didnt knows how ALL of yours plugins works
But I have a question
just create a profile in which you automatically build the plugin inside the servers /plugins and start the server
so you can also do exception handling in your IDE
how do /reload from plugins work?
Why not just recompile from IDE?
like /essentials reload
that reloads the config
not the entire plugin
hmm
load stuff you loaded at enable again and/or disable-enable the plugin
but I am compiling again the plugin
it basically just rereads the config and stores the new one
so I need to reload whole plugin right?
yeah
so I disable and enable instead of reloading?
NO
omg
bro, for developments, just create a server with YOUR PLUGIN and THE DEPENDENCIES
i mean what even is your goal
I am in a separate server where I test my plugins
To fix an issue here but idk they hated plugman rlly bad
so just restart your server
ok, if you knows your plugin will not broke with a simple reload, use
i just jumped in
but please, dont kill the server, RESTART! has a difference between just closing the cmd and use the /stop command
💀
I wont kill the server
nah just close cmd
Ik how the server works
i do that all the time
just close cmd will not fire the onDisable
I just kill discord bots
doesnt matter if you dont have one
Doesn’t matter unless you are specifically testing shutdown logic
Like data saving or whatnot
^
I usually use /reload on my test server anyway tbh
well I'lll keep working on my plugin
Not plugman though get that outta here
me too
if I need help ill ask
oki
👍
isn't plugman discontinued or something?
never heard about
plugwoman
yeah
the new fork
my father will ban you from discord
what are you expecting
😆
at least it isn't plugmayonaiseonachair
PlugWoman really exists???!
yes
💀
xd
Intro Let's be honest: PlugMan is outdated and very often fails to reload even the simplest of plugins. PlugWoman is a very lightweight and simple plugin which can reload most plugins without issue. Note, however, that reloading is still an unsupported operation for many plugins, and not all plugins can be reloaded safely.
everyone out here hating plugman xd
@hybrid spoke for a safe plugin disable, we need to execute the onDisable method, and setEnable(false) no?
Hey
oh wait, setEnable() already executes the onDisable method
Someone is familiar with SlimeFun?
Oh hey it's my plugin
Yeah plugman is shit lol
If you want to disable your plugin from within
xd
for a clean plugin disable you just remove it from your plugins folder
@waxen plinth you are a very original dev
Use Bukkit.getPluginManager.disablePlugin
thanks
yw
it's not a fork though
I REALLY AGREE WITH THAT
not much to fork there
just ask
If you ask the question, yes
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
for each plugin in plugin folder, disablePlugin. for each plugin in plugin forlder, enablePlugin EZ reload plugin created
Or you could just /rl
Also that won't work
starts to search for the docs because he doesn't understand to see if you guys do because i am a noob :(
now try 😆
im joking
You need to reload them respecting dependencies
?jd
?jd
you parrots
👍
how much time you code?
follow the wiki page bro
like imagine don't having a life
Rather than asking here
thats a good question
Asking a fucking wall and asking in there
i will kill myself, bye!
== True
💀
have a good death
Does slimefun still have wack code
most likely
idk but their support is trash
so that's why I am asking here
because is a more noob-friendly zone
Well I don't think any of us have used slime fun
So I don't think we'll be able to help you
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
no man
?jd
ik java
then you can read the guide
idk minecraft java
yes
so you dont
he knows the entire java!!
I helped develope it
obviously
oh he's notch
who you think i am
write me a program to prove to me you know all of java
ok
a program that takes in ints from stdin until the user types "done" and then prints the sum of all numbers entered
but
do it with a one-liner
I don't think that will solve the problem
wheres your class declaration
So there is a simple solution to "knowing java" but not knowing "minecraft java"
This is gonna blow your mind:
?jd
?jd
For real though read wikis and documentation
🤔
plugwoman
no I got that
gonna decompile this
have fun
inserts virus for dos botnet*
Nice try
public class Main
{
private static final String LINK = "https://www.youtube.com/watch?v=dQw4w9WgXcQ";
public static void main(final String[] args) throws IOException, URISyntaxException {
Desktop.getDesktop().browse(new URL("https://www.youtube.com/watch?v=dQw4w9WgXcQ").toURI());
}
}
bruh
I would recognize that link anywhere
💀
its for people doubleclicking plugins
Oh lol
Stream best class thank you very much
well i'll continue trying to understand slimefun's wiki
good boy
A question
yes
no
In mongodb its possible to save ItemStack?
yes
I know the answer to that question
Sure
?jd
serialize it
yw
My library has a method to serialize items
But i cannot im not using yaml
ItemUtils.toString and ItemUtils.fromString
Turn it into a byte array or base64 string
|| too many new things I recognize but don't udnerstand ||
This is why I use minimize
Basically the method i sent 2 weeks befre used to serialize and deserialize packets
That's fair honestly
Remeber?
?
Using a library and minimizing honestly sounds like a very reasonable solution
I am sure mine is not the only library that has a method like this
declaration: package: org.bukkit.event.world, class: PortalCreateEvent
Beat me to it
ty
How much would you ask for coding 2 methods:
byte seriliaze(Packet packet) -> serialize packet object (a class implemeting packet class) to bytes
T deserialize(byte[] bytes) -> deserialize bytes to packet object
Just use the ones in redlib
Ah I didn’t read
But it only has a helper method for items
Thought we were still on itemstacks
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Ah lol i didnt know there was a link for asking
Just turn the object into json and then turn the json string to a byte array
kinda a good idea honestly
Json giu
I dont wanna think in json
json is good
🤢
it's the only good thing to come out of js
Gson makes it easy
Not good when working with packets
how do you think discord works
Its an example saying that its to much
Not even spigot, it’s in vanilla
No
Someday redlib will be in vanilla
I tried and it doesnt find the methods
Not even for anything, since vanilla is obviously not spigot
Well you would have to import the NMS jar
But I will pay microsoft $300 billion to shade redlib into all copies of minecraft
Gson is in fact used in vanilla
No
For me maven doesnt resolve the methods
Let say, its find me the method. But then the plugin throws error
org.json > gson 😎
I should rewrite my json parser to be faster
It's already faster than gson but not by a lot
And I know gson is not the fastest json parser
I think jackson is faster
What’s that new one
One thing that's annoying is that java doesn't support string slicing
Which would make json parsing much faster
But you explain me how to serialize?
(Moshi)
no thank you
I can pay you
no thank you
I think i have some dollars on paypal
😕
Wait its possible to serialize and deserialize using ObjectInputStream + ByteArrayInputStream?
Yes that's java serialization and it's pretty bad
That its what do serialize class from java api?
uh
yes?
I think you're asking "is that what the Serializable class does?"
?paste
Thank you
WHy?
?paste
yeah
Its easy for get help
If that's your question then the answer is because large code blocks take up a lot of space in chat
what's the reason
Anyways what's your question
Did you register your listener
It work, you dont know how to use it
Also mobile doesn’t have the nice text file viewer yet
Also your class names should be uppercase, not lowercase
it does work when I reload it
@terse ore wrong color import
it works 50 50
So Tracker instead of tracker and Color instead of color
Can we see your main class
?paste
I don't see you doing registerEvents(new tracker()) anywhere
Also please do rename your classes to start with capital letters
why capitals?
It's the naming convention
Having everyone follow for consistency makes code more clear
CamelCase class names
okk
PascalCase
Potato potato
fIsHCASE
Can anyone tell me the name of the event when an item for example is in a craftingtable and returns to the inventory by canceling or closing the inventory without completing the action?
?jd
this I know, but this specific one I didn't find
Hello, I've been looking for a plugin to sell things with posters that recommend essentials for a while, it doesn't work for me, stores aren't created
Plis help
anyone know why im getting this message?
java.lang.NullPointerException: Cannot invoke "org.bukkit.scoreboard.ScoreboardManager.getNewScoreboard()" because "this.manager" is null
this is the code
Try creating the scoreboard in your on enable
Also Intellij seems to be warning you. Take a look at what it says
Why many people do Main class final?
So people don't extend it
Although I'm guessing that one is from a tutorial or template
Any class that its fianal cannot be extended
Should permission nodes be registered through plugin.yml or through pluginManager.addPermission?
Hmm, was thinking about using a Map to register the plugins then retrieve the Permission object from the Map whenever I check for it.
So I account for any changes to naming
How would one go about fetching the default attributes for an entity type?
i can't seem to find anything about it
Any good docs for reading about bungeecord permissions api?
Or atleast doesnt bungeecord have an api for managing permissions?
LuckPerms helped me out a lot with bungee, especially after I added an sql database
Do you have some examples?
I would be working with bungee perms api
Like im not going to use luckperms
Im asking if they helped you with the Bungeecord permissions api itselft
will Inventory#addItem drop items to the floor if the item is filled. It says it returns a HashMap, but how do I make the items in the hashmap drop to the player
Iterate over the map and drop all items that weren't added
oh okay!
Simplest way would be addItem(item).values().forEach(i -> player.getWorld().dropItem(player.getLocation(), i))
does anyone know any 1.8.8 ForgeGradle patcher mappings?
This doesn't seem like the right place to ask
Definitely not. 7 year old version and completely wrong software lol
Forge is going to beat your ass if you ask them in their cord though
exactly
nah but i thought since it was more of a general minecraft mapping thing
and im trying everything
ive been stuck on this problem for 3 fucking days
preventing me from working on the project at all
Why's that?
They do something that I wish we did, and they will outright ban you if you ask for support for anything less than the current or most recent version of MC
late response, but it's because the Minecraft extension for Intellij IDEA automatically makes the main class like that
I hate 1.8 but I am getting help from someone to support it
yeah but i was asking about the client, which is still widely used in pvp (1.8), so i feel like there should be al least some support, because even on the forums they dont support questions about 1.16 or lower anymore
I hate < 1.12
I heavily dislike the 1.9+ pvp, so I'm working on a patch for the server jar to try and fix that
hopefully it works lol
its just compiling a server jar, editing the code, and rebuilding it
arent they just git changes in a file
ye
Any idea how to set a timer for a player when they interact with something?
I.E "Wait x amount of seconds before using the sign again"
?scheduling
that
ty
Anyone able to help me with this?
Hi I am making a plugin where if someone throws a special enderpearl the player will get mounted but I don't understand how to do the checks for this like checking if it has a display name so far this is my main class```java
private ItemStack epearl = new ItemStack(Material.ENDER_PEARL);
private ItemMeta meta = epearl.getItemMeta();
@Override
public void onEnable() {
System.out.println("Enderpearlpassenger activated...");
meta.setDisplayName(ChatColor.BOLD + ChatColor.GOLD.toString() + "Riding Enderpearl");
epearl.setItemMeta(meta);
ShapedRecipe s = new ShapedRecipe(new NamespacedKey(this, "ride_epearl"), epearl);
s.shape(
"EEE",
"EDE",
"EEE");
s.setIngredient('E', Material.ENDER_PEARL);
s.setIngredient('D', Material.EMERALD);
Bukkit.addRecipe(s);
}``` and this is my event ```java
@EventHandler
public void onShoot(ProjectileLaunchEvent e) {
if(e.getEntity().getType() == EntityType.ENDER_PEARL && e.getEntity().getShooter() instanceof Player) {
}
}``` does anyone know how to check the display name or add more checks to this?
Just doesn't make any sense to me :/
i dont understand how they work internally, neithr do i know how to use them
so all i know is that they are changes
yeah same lmao
basically
took me a week to figure out how to apply patches to a server correctly
(thats just cause im an idiot)
how do patches like decide where to edit
I must be stupid then :/
yeah but if someone changes the file numbers does it break?
like if someone adds one line before it does it break everything
or is it relative of some sort
pom.xml?
it's generated by Git
?
i know
Doi you know where i can find bungeecord permissions javadocs?
I wana create a custom permission plugin for bungee
Oh no... That's linked to the other system isn't it?
Allright thanks
I can't stand maven
Pom.xml??
that pom at the top is just a diff file
it's notepad++ so all diff files are open
Idk why spigot people are so addicted to maven though
I just started with maven, and it's easy for me, but gradle is nicer now that ive started to use it
It's truly not
Maven is simple and clean. Gradle is way more complex.
i love it but it melts my brain
Gradle is tidier imo
gradle is way more complex to start I do agree
I still have no idea how to do 90% of it
lol
me neither
Okay, it's slightly confusing at the start but once you get going it's amazing
yeah i prefer gradle but it can get really complex
get the enderpearl as projectile and check for a name
I cant say how long ive had to debug a stupid maven error for no reason
does Customname work as the same thing as display name?
Gradle points you exactly to the line
gradle > maven but maven ftw.
yeah I had to debug a gradle error and it was much nicer
still have like no knowledge of it but it works for me atm
no, 2 different things but doesn't matter in this case because there is no displayname
I can't do module shit fully yet but yeah
Some people somehow just do it and I'm like... How?!
gradle aswell
I am just shit at it
if im not sure about something I just keep trying till it works right lmao
might take 20 times longer but I learn from it
Oh I've spent ages trying to do it
google is your boyfriend in this case
google is always the best bet
Google blocked my number for asking too many times 😫
L
just L him
L
lol, "Just L him"
Am I the only one who has a bit of a list of devs who'd I celebrate if they quit? lol
why would you mention that
now half of us are asking like, wait, are we on that list?
hopefully i am
It's very small.
the token enchant dev, the kid who helps him and the rev enchants kid currently...
lmao
some dont like the dev of it
I mean I hate the rev enchants kid so much
bruuhh
$35 for the initial plugin then it's like $25 per enchant
WHAT
yeah
Yep
its stupid
How would I check if player is on fire using Entity Metadata?
Because he starts a new thread then starts a bukkit task within that thread to run the action sync again. Because async = better performance
35 euro for base
15 euro for rankup
20 euro for Backpacks
Why do you want to use the metadata for that?
i made a manhunt plugin like 2 years ago and i remember just completely ignoring the bugs and only adding more features
Well not just for that, but a few other things
Just use the api methods 😄
reminds me of my anti-autoclicker
Like if they are gliding, sneaking, sprinting, invisiblem etc.
like it has an addon loader, multiple speedrunners, titles, fancy compass name selector gui, and then theres seven hundred thousand bugs
I know I can, but I want to learn how to check the metadata this way
just pressing features between everything without caring at all
yeah lmao
because I'm also gonna check metadata for if the clients skin parts are enabled
sleep paralysis
Then you need to dive into the CraftBukkit implementation and see how they use NMS for retrieving this data.
even worse if the project is 2+ years old
yeah
and you updated it const.
EWG.
Yikesm thanks Ill try that
Don't ya love it when you make your friend a crazy amount of money (in 6 figures) and he gives you nothing in return to say thanks? 🥲
did u do the work for him
also i just realized weve been talking about random shit in #help-development the whole time
And then i add permisions to a player?
It doesnt exists object Attachment etc
how do i read incoming packets?
using the channel duplex handler
it doesn't seem to be possible to override read() anymore in 1.18
I mean you can but theres no packet in the arguments
why doesnt this work
Scoreboard b = m.getNewScoreboard();
Objective obj = b.registerNewObjective("name", "dummy", "Test");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
obj.setDisplayName("TESTNAME");
e.getPlayer().setScoreboard(b);``` it does nothing
how to make reducer bot with citizen ?
You're not doing anything except registering the Objective. You have to set a score for the Player for it to render afaik
What
i dont see a method for that
google it reducer bot minecraft
or join bridger.land
Objective#getScore() returns a Score object
yeah but thats not setting it
bugs are just unintended features
Once you have the Score object you can set it 😄
but whats the method to set it
Score#setScore()
also what does it mean entry? is that the name of the board?
No, it's just the name. Probably want to set it to your player's username.
Can someone explain how bitmasks work when you combine them? For example, (0x01,0x02, 0x04, 0x08, 0x10, 0x20, 0x40) combined is 127, how sthis
ight ty
Objective obj = b.registerNewObjective("name", "dummy", "Test"); would it be "name" or "Test" because 1 says displayname and 1 says name
Neither, Scores are attached TO Objectives. Don't change your construction of it.
Just use that obj to get the Score and set it.
Cannot resolve method 'getScore(org.bukkit.scoreboard.Objective)'
ohh
so i should set "name" to the players name as well?
No
?? but if im getting the players name at the entry why would i not make that the name of the socreboard
An objective can have multiple entries.
Is there a way to stop a player from loading a bow? (not all the time just under a specific condition)
yeah but where did i set the players name as an entry? if im getting the players name as an entry i wouldve had to have set it somewhere
I don't think you do
then where does the players name come from
hello how do i remove the [ ]
/**
* @param text The string of text to apply color/effects to
* @return Returns a string of text with color/effects applied
*/
public static String translateColorCodes(String text) {
ArrayList<String> texts = new ArrayList<>(Collections.singleton(text));
for (String value : texts) {
if (value.equalsIgnoreCase("&")) {
Bukkit.getLogger().info(value);
}
}
return texts.toString(); // result -> [H4zlq Joined]
}
The entry can be called whatever you want.
If you use a Player's name, it's attached to that player, other wise it's a fake player.
^ and fake player's aren't attached to anything
Are you just trying to color text?
yes
i want to make it support the & and hex color
Use ChatColor.translateAlternateColorCodes()
ah thanks but is it possible to just display text or something because i want it to say "Rank #" so "# <text>" doesnt really work
Use teams
[] comes from toString(), you should only ever use toString() for debug messages.
And also, as Dessie said, use translateAlternateColorCodes.
how do i make it support hex color like #ffa500
I'm pretty sure color codes don't support hex colors.
They do, that's what &x does
I think it's &x proceeded by 6 &<character of HEX>
oh
So &x&f&f&f&f&f&f is white
@hasty prawn do you know someone that works with ChunkGenerators? I have some questions...
That is
Kinda awful ngl
Yeah it is lol
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
i'm working on a ChunkGenerator plugin, but i can't do a smooth biomes transitions
And i want some help, some formulas, and tips...
What kind of noise do you use?
SimplexOctave
And whats your resolution? One cell = one Chunk?
Sorry what?
why is public void ExperienceListener(PlayerExpChangeEvent e) { not being run when i use /xp set <me> 100
Lol, its is from the Bukkit's ChunkGenerator class?
Because you dont call it probably 😄
I didnt heared about that 😱
wdym? i have it registered?
Did you use the @EventHander anoyation?
yep
public void ExperienceListener(PlayerExpChangeEvent e) {
Bukkit.getLogger().info("tes");```
Registered the listener class intocyour main?
yep
this.getServer().getPluginManager().registerEvents(new ExperienceHandler(), this);
Ok thats not normal
:/ thats rly dumb
Test with another debug event
Like AsyncPlayerChatEvent
To see if listener works properly
its because this
Oh ok
is there no alternate method?
Recreating the command
its hard to trigger events for a raw command like /exp set
Why?
exp change probably not a good example and I'd need to look into it more
but consider like /data changing stuff
Workaround for now: Listen to the command in the command preprocess event
idk what youre trying to do
why do people use databases when you can just store your data in chunk 0,0’s pdc?
/exp set is basically an admin override command
Any recommendations on creating a chunk generator that referances a different chunk?
you can't
hm? I have one working
perhaps you want a block populator instead
what are you trying to make with this?
every 2x2 of chunks is a scaled up version of another chunk
i have
Scoreboard b = m.getNewScoreboard();
Objective obj = b.registerNewObjective(e.getPlayer().getName(), "dummy", "rank");
obj.setDisplaySlot(DisplaySlot.BELOW_NAME);
obj.getScore(e.getPlayer().getName()).setScore(e.getPlayer().getLevel());
e.getPlayer().setScoreboard(b);```
it works fine for me it displays my xp but when another player joins it doesnt work it just says 0 rank but they have levels
yeah in creating one for each player because each player will have different amount of xp
public void potLuck(EntityDeathEvent e){
for (ItemStack item : e.getDrops()){
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
Recipe recipe = iter.next();
if (!(recipe instanceof CookingRecipe)) continue;
if (((CookingRecipe) recipe).getInput().getType() != item.getType()) continue;
result = recipe.getResult();
item.setType(result.getType());
break;
}
}
}
Hi! so I was making an enchantment for autosmelting food
This is what I have written so far
It isn't working tho; can someone tell me what's wrong with it?
Whats the best practice to getting the instance of another plugins main class
Why do you need to
forget the @EventHandler? Register the listener?
Listener is there...
public class EntityDeath implements Listener {
Player player;
Entity entity;
ItemStack itemInHand;
ItemStack result;
@EventHandler
public void onEntityDeath(EntityDeathEvent event) {
if (!(event.getEntity() instanceof Player)) {
return;
}
EntityDamageEvent e = event.getEntity().getLastDamageCause();
if (!(e instanceof EntityDamageByEntityEvent)) {
return;
}
EntityDamageByEntityEvent nEvent = (EntityDamageByEntityEvent)e;
if (!(nEvent.getDamager() instanceof Player)) {
return;
}
player = (Player)nEvent.getDamager();
itemInHand = player.getInventory().getItemInMainHand();
if (itemInHand == null) return;
if (!itemInHand.hasItemMeta()) return;
if (itemInHand.containsEnchantment(CustomEnchants.POTLUCK)) potLuck(event);
}
did you register it
what the hell are you doing lmao
EntityDamageEvent e = event.getEntity().getLastDamageCause();
No chance of that returning a lastDamageCause
?jd
How do I get the killer then...?
LivingEntity#getKiller?
I have no idea what you are doing above but this is basic bukkit / java
you're IDE should be yelling at you
Nevermind.. Bukkit is weird
But yeah you want to be using LivingEntity#getKiller rather than another event
Oh I just realized I made a mistake
if (!(event.getEntity() instanceof Player)) {
return;
}
I added a "!" accidentally lol
Lol
can someone help
Should I update the disk everytime a file gets updated
or only when the server is closed
another thing is there anyway to show a value under the item like the item: stone when you have advanced viewing on
not like lore
Hey, i need help.
I'm trying to keep endermans from teping when they take water damage.
DamageCause DamageCause = e.getCause();
if(DamageCause == org.bukkit.event.entity.EntityDamageEvent.DamageCause.FIRE ||DamageCause == org.bukkit.event.entity.EntityDamageEvent.DamageCause.FIRE_TICK || DamageCause == org.bukkit.event.entity.EntityDamageEvent.DamageCause.HOT_FLOOR || DamageCause == org.bukkit.event.entity.EntityDamageEvent.DamageCause.LAVA ){
double damage = e.getDamage();
e.setDamage(damage*4.5);
}
if(DamageCause == org.bukkit.event.entity.EntityDamageEvent.DamageCause.FALL) {
double damage = e.getDamage();
e.setDamage(damage*2);
}
if(DamageCause == EntityDamageEvent.DamageCause.SUFFOCATION) {
e.setDamage(e.getDamage()*10);
}
if(e.getEntity() instanceof Enderman) {
if(DamageCause == EntityDamageEvent.DamageCause.DROWNING) {
e.setCancelled(true);
}
}
}```
teleportevent
I just cancel that?
How?
?jd
plugin has no api
yikes
that might suck lol
iirc you can use RegistryProviders
Let me see if I can find something on spigot
Im not able to find any good (or any at all) articles on it, and have never used it myself, someone else might be able to help you tho
recursion is scary
hey, I have a question, how would I code a new axolotl variant into a plugin?
hm?
explain
you could just get one of the varients
add a custom model data to it
and retexture it
Can I give a wolf a player skin?
How do I "register" or something another plugins events to my plugin? I implemented them via @eventhandler but it does not get called it seems
did you register the listener as with normal events
is the other plugin calling the events
thats really all there is to it
Yes
getServer().getPluginManager().registerEvents(new ArmControlListener(), this);
However I am not 100% sure if I should have used "this" or reference to their own plugin?
I checked their source and it seems right to me
where they call my specific event I need
Axolotls dont run on custom model data
They are not items
But I took a look at the nms
It seems like it may be possible to change the axolotls' variant enum to a different id and name
Whether that allow us to use different textures is still unknown
And may break spigot
yea
You're unlikely to get any useful help for it
I mean some people might know what they doing?
You can ask, just don't necessarily expect an answer
?askgoodquestion nonetheless
is there a way to add a contract to the source.isPlayer method so the compiler knows when i check that the player is present that source.getPlayer.get wont throw an exception?
does source::getPlayer return an optional?
yea
Cache it?
hi
and invoke sth like isEmpty() -> return
Either you choose to be the least common denominator
Or you create a powerful abstraction, alternatively excruciate yourself with reflection
Maven has nothin to do with your Java skillset tho
Not at Java necessarily
Just at maven?
where i can learn java ?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Untrue
Maybe better to uee ifpresent tho
FourteenBrush sure but going declarative because some dude thought it was always good is probably wrong

Hmm
Theres nothing wrong with:
Optional o = asOptional()
if o.isEmpty{
return
}
Object oo = o.get()
raw type 😮
anyways, can't you use orElse(null)
I wanna test if an elytra breaks but ofc the elytra isn't in your hand
so now i was thinking of using this
but i don't understand it
what are you doing
I am using https://advancements.thedestruc7i0n.ca/
are you making plugins
then just ask, but dont expect an answer lol
need help turning it off?
like i know where to turn it off
but i just dont want to, even though that makes me unhappy
laziness extreme
Npr yeah
what should my database pk be like? its uuid rn
but i dont like uuid displaying first cuz its ugly
:(
I mean using uuid as primary key is fine?
my bad, i didn't get what you were trying to do haha
I'm making a SkyWars plugin for a friend. I've been thinking of the best way to do this and want your thoughts.
Filling chests, on loading into the game? Or when a player opens the chest.
I was thinking of making the chests unable to be broken or exploded.
I’d fill all chests in the beginning
and fill them each 5 minutes
Since the chest might get broken or opened other ways than what a player is a capable of
make a refilling class
What will be the path for this?
and you can just do
Drop.AXOLOTL.Chance
refillingClass.generateItems();
How does your first question relate to the latter information
you can also getConfigurationSection("Drop").getConfigurationSection("AXOLOTL").get("Chance");
right?
Yeah tho that could cause NPE given that any of the nonlast methods return null
I use that
but none of it should be null
if it is then it will print a warning so ig
I’m using launchProjectile for the tnt firing
It’s asking for a subclass for that method
what class
Depends on what entity type you want
oh player
We really don’t know what you want here
u cant
I don’t know maybe look at the tnt interface then?
with that method
tnt doesnt extend projectile
Snowball for example does
AbstractArrow, Arrow, DragonFireball, Egg, EnderPearl, Fireball, Firework, FishHook, LargeFireball, LingeringPotion, LlamaSpit, ShulkerBullet, SizedFireball, SmallFireball, Snowball, SpectralArrow, SplashPotion, ThrowableProjectile, ThrownExpBottle, ThrownPotion, TippedArrow, Trident, WitherSkull
Got this error
org.bukkit.configuration.InvalidConfigurationException: mapping values are not allowed here
new Refilling(map, lootTable, lootStrategy).refill() 🙂
these are your only options
show how you did it
eitherway Chance:
doesnt have anything
in front of it
right?
Ah that’s helpful, thanks
?jd-s tho
wdym?

